Debian Codegraph @

addons/sale/static/tests/tours/product_attribute_value_tour.js

raw symbols SCIP
1 import { registry } from "@web/core/registry";
2 import { stepUtils } from "@web_tour/tour_utils";
3
4 const openProductAttribute = (product_attribute) => [
5 ...stepUtils.goToAppSteps("sale.sale_menu_root", "Go to the Sales App"),
6 {
7 content: 'Open configuration menu',
8 trigger: '.o-dropdown[data-menu-xmlid="sale.menu_sale_config"]',
9 run: "click",
10 },
11 {
12 content: 'Navigate to product attribute list view',
13 trigger: '.o-dropdown-item[data-menu-xmlid="sale.menu_product_attribute_action"]',
14 run: "click",
15 },
16 {
17 content: `Navigate to ${product_attribute}`,
18 trigger: `.o_data_cell[data-tooltip=${product_attribute}]`,
19 run: "click",
20 },
21 ];
22 const deletePAV = (product_attribute_value, message) => [
23 {
24 content: 'Click delete button',
25 trigger: `.o_data_cell[data-tooltip=${product_attribute_value}] ~ .o_list_record_remove`,
26 run: "click",
27 },
28 {
29 content: 'Check correct message in modal',
30 trigger: message || '.modal-title:contains("Bye-bye, record!")',
31 run: "click",
32 },
33 {
34 content: 'Close modal',
35 trigger: '.btn-close',
36 run: "click",
37 }
38 ]
39
40 // This tour relies on data created on the Python test.
41 registry.category("web_tour.tours").add('delete_product_attribute_value_tour', {
42 url: '/odoo',
43 steps: () => [
44 ...openProductAttribute("PA"),
45 // Test error message on a used attribute value
46 ...deletePAV("pa_value_1", ".text-prewrap:contains('pa_value_1')"),
47 // Test deletability of a used attribute value on archived product
48 ...deletePAV("pa_value_2"),
49 // Test deletability of a removed attribute value on product
50 ...deletePAV("pa_value_3"),
51 {
52 content: 'Check test finished',
53 trigger: 'a:contains("Attributes")',
54 }
55 ]
56 });