bemade_fsm: Completed integration test tour for adding equipment to a client. Closes #11.

This commit is contained in:
Marc Durepos 2023-06-15 19:34:40 -04:00
parent 3a5f31a5b4
commit edf917664f
3 changed files with 72 additions and 47 deletions

View file

@ -1,7 +1,9 @@
/** @odoo-module **/ /** @odoo-module **/
import tour from 'web_tour.tour'; import tour from 'web_tour.tour';
const TEST_COMPANY = "Test Partner Company";
const TEST_EQPT1 = "Test Equipment 1";
const TEST_EQPT2 = "Test Equipment 2";
tour.register('task_equipment_tour', { tour.register('task_equipment_tour', {
test: true, test: true,
url: '/web', url: '/web',
@ -26,26 +28,48 @@ tour.register('task_equipment_tour', {
}, { }, {
content: 'Set the name', content: 'Set the name',
trigger: 'input[name="name"]', trigger: 'input[name="name"]',
run: 'text Test Tag Name', run: `text ${TEST_EQPT2}`,
}, { }, {
content: 'Set the partner', content: 'Set the partner',
trigger: 'div[name="partner_location_id"] div div input', trigger: 'div[name="partner_location_id"] div div input',
run: 'text Test Partner Company', run: 'text Test Partner Company',
}, { }, {
content: 'Click the partner in the dropdown', content: 'Click the partner in the dropdown',
trigger: 'li a.dropdown-item:contains(Test Partner Company)', trigger: `li a.dropdown-item:contains(${TEST_COMPANY})`,
}, { }, {
content: 'Save', content: 'Save equipment',
trigger: 'button.o_form_button_save', trigger: 'button.o_form_button_save',
}, {
/* Navigate to the client and make sure that there are two equipments saved (one from the Python test case) */
content: 'Navigate to the Clients submenu',
trigger: 'button.dropdown-toggle[data-menu-xmlid="bemade_fsm.menu_service_client"]',
}, {
content: 'Click on the clients submenu',
trigger: '.dropdown-item[data-menu-xmlid="bemade_fsm.menu_service_client_clients"]',
}, {
content: 'Search for the Test Partner Company',
trigger: 'input.o_searchview_input',
extra_trigger: 'li.breadcrumb-item.active:has(span:contains(Customers))',
run: `text ${TEST_COMPANY}`
}, {
content: 'Validate Search',
trigger: '.o_menu_item.o_selection_focus',
run: 'click',
}, {
content: 'Open the test client.',
trigger: `div.o_kanban_record:has(span:contains(${TEST_COMPANY}))`,
}, {
content: 'Click the Field Service tab.',
trigger: 'a.nav-link:contains(Field Service)',
extra_trigger: `h1 span.o_field_partner_autocomplete[name="name"]:contains(${TEST_COMPANY})`,
}, {
content: 'Make sure we have a first test equipment',
/*trigger: `div[name="equipment_ids"]:has(td:contains(${TEST_EQPT1}))`,*/
trigger: `td:contains(${TEST_EQPT1})`,
run: function() {},
}, {
content: 'Make sure we have a second test equipment',
trigger: `div[name="equipment_ids"]:has(td:contains(${TEST_EQPT2}))`,
run: function() {},
} }
// 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
// Now make another one, but from the Partner interface
// Navigate to Service > Clients > Clients
// Search for and open the test client
// On the "Locations" tab, add a location
// Open the location and add a new Equipment to its equipment list
// Create a task in the test project
]) ])

View file

@ -25,6 +25,7 @@ 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',
'partner_location_id': cls.partner_company.id,
}) })

View file

@ -18,7 +18,7 @@
groups="industry_fsm.group_fsm_user"/> groups="industry_fsm.group_fsm_user"/>
<menuitem id="menu_service_client_clients" <menuitem id="menu_service_client_clients"
name="Clients" name="Clients"
action="account.res_partner_action_customer" action="base.action_partner_customer_form"
sequence="20" sequence="20"
parent="menu_service_client" parent="menu_service_client"
groups="industry_fsm.group_fsm_user"/> groups="industry_fsm.group_fsm_user"/>