bemade_fsm: Added and modified some tests for #11.
This commit is contained in:
parent
641342d5c0
commit
7e334d54ea
5 changed files with 49 additions and 15 deletions
|
|
@ -46,6 +46,7 @@
|
||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_tests': [
|
'web.assets_tests': [
|
||||||
'bemade_fsm/static/tests/tours/task_template_tour.js',
|
'bemade_fsm/static/tests/tours/task_template_tour.js',
|
||||||
|
'bemade_fsm/static/tests/tours/task_equipment_tour.js',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,39 @@
|
||||||
/** @odoo-module **/
|
/** @odoo-module **/
|
||||||
|
|
||||||
// Navigate to the Service > Clients > Equipment menu
|
import tour from 'web_tour.tour';
|
||||||
// Click the Create button
|
|
||||||
|
tour.register('task_equipment_tour', {
|
||||||
|
test: true,
|
||||||
|
url: '/web',
|
||||||
|
}, [tour.stepUtils.showAppsMenuItem(), {
|
||||||
|
content: 'Navigate to the Service menu',
|
||||||
|
trigger: '.o_app[data-menu-xmlid="industry_fsm.fsm_menu_root"]',
|
||||||
|
}, {
|
||||||
|
content: 'Navigate to the Clients submenu',
|
||||||
|
trigger: '.o_app[data-menu-xmlid="bemade_fsm.menu_service_client"]',
|
||||||
|
}, {
|
||||||
|
content: 'Navigate to the Equipment menu',
|
||||||
|
trigger: '.o_app[data-menu-xmlid="bemade_fsm.menu_service_client_equipment"]',
|
||||||
|
}, {
|
||||||
|
content: 'Click the create button',
|
||||||
|
trigger: '.o_list_button_add',
|
||||||
|
extra_trigger: 'li.breadcrumb-item.active:has(span:contains(Equipment))',
|
||||||
|
}, {
|
||||||
|
content: 'Add a tag',
|
||||||
|
trigger: 'input[name="pid_tag"]',
|
||||||
|
run: 'text TestPIDTag',
|
||||||
|
}, {
|
||||||
|
content: 'Set the name',
|
||||||
|
trigger: 'input[name="name"]',
|
||||||
|
run: 'text Test Tag Name',
|
||||||
|
}, {
|
||||||
|
content: 'Set the partner',
|
||||||
|
trigger: 'input[id="o_field_input_303"]',
|
||||||
|
run: 'text Test Partner Company',
|
||||||
|
}, {
|
||||||
|
content: 'Click the partner in the dropdown',
|
||||||
|
trigger: 'li a.dropdown-item:contains(Test Partner Company)',
|
||||||
|
}
|
||||||
// Fill in the required fields, including creating a new Client Location and PID Tag
|
// Fill in the required fields, including creating a new Client Location and PID Tag
|
||||||
// Navigate to the client location, then to the client, making sure that the equipment and client location links appear
|
// Navigate to the client location, then to the client, making sure that the equipment and client location links appear
|
||||||
|
|
||||||
|
|
@ -12,3 +44,4 @@
|
||||||
// Open the location and add a new Equipment to its equipment list
|
// Open the location and add a new Equipment to its equipment list
|
||||||
|
|
||||||
// Create a task in the test project
|
// Create a task in the test project
|
||||||
|
])
|
||||||
|
|
@ -10,7 +10,7 @@ tour.register('task_template_tour', {
|
||||||
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
|
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
|
||||||
}, {
|
}, {
|
||||||
content: 'Open the task templates list view.',
|
content: 'Open the task templates list view.',
|
||||||
trigger: '.o_nav_entry[data-menu-xmlid="bemade_fsm.task_template_menu"]',
|
trigger: '.o_nav_entry[data-menu-xmlid="bemade_fsm.project_task_template_menu"]',
|
||||||
}, {
|
}, {
|
||||||
content: 'Open the existing task template.',
|
content: 'Open the existing task template.',
|
||||||
trigger: '.o_data_cell:contains("Template 1"):parent()',
|
trigger: '.o_data_cell:contains("Template 1"):parent()',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
from odoo.tests.common import TransactionCase, HttpCase, tagged
|
from odoo.tests.common import TransactionCase
|
||||||
from odoo.tools import mute_logger
|
|
||||||
from odoo.exceptions import MissingError
|
|
||||||
from odoo import Command
|
|
||||||
from psycopg2.errors import ForeignKeyViolation
|
|
||||||
|
|
||||||
|
|
||||||
class FSMManagerUserTransactionCase(TransactionCase):
|
class FSMManagerUserTransactionCase(TransactionCase):
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
from odoo.tests.common import HttpCase, tagged
|
from odoo.tests.common import HttpCase, tagged
|
||||||
from odoo.tools import mute_logger
|
|
||||||
from odoo.exceptions import MissingError
|
|
||||||
from odoo import Command
|
|
||||||
from psycopg2.errors import ForeignKeyViolation
|
|
||||||
from .test_bemade_fsm_common import FSMManagerUserTransactionCase
|
from .test_bemade_fsm_common import FSMManagerUserTransactionCase
|
||||||
|
|
||||||
class TestEquipmentCommon(FSMManagerUserTransactionCase):
|
class TestEquipmentCommon(FSMManagerUserTransactionCase):
|
||||||
|
|
@ -17,8 +13,8 @@ class TestEquipmentCommon(FSMManagerUserTransactionCase):
|
||||||
'company_type': 'company',
|
'company_type': 'company',
|
||||||
'street': '123 Street St.',
|
'street': '123 Street St.',
|
||||||
'city': 'Montreal',
|
'city': 'Montreal',
|
||||||
'state_id': cls.env['res.country.state'].search([('name','ilike','Quebec%')]),
|
'state_id': cls.env['res.country.state'].search([('name','ilike','Quebec%')]).id,
|
||||||
'country_id': cls.env['res.country'].search([('name','=','Canada')])
|
'country_id': cls.env['res.country'].search([('name','=','Canada')]).id
|
||||||
})
|
})
|
||||||
|
|
||||||
cls.partner_contact = cls.env['res.partner'].create({
|
cls.partner_contact = cls.env['res.partner'].create({
|
||||||
|
|
@ -29,4 +25,12 @@ class TestEquipmentCommon(FSMManagerUserTransactionCase):
|
||||||
|
|
||||||
cls.equipment = cls.env['bemade_fsm.equipment'].create({
|
cls.equipment = cls.env['bemade_fsm.equipment'].create({
|
||||||
'name': 'Test Equipment 1',
|
'name': 'Test Equipment 1',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@tagged('-at_install', 'post_install')
|
||||||
|
class TestEquipmentTour(HttpCase, TestEquipmentCommon):
|
||||||
|
|
||||||
|
def test_equipment_tour(self):
|
||||||
|
self.start_tour('/web', 'task_equipment_tour',
|
||||||
|
login=self.user.login, )
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue