Debian Codegraph @

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

raw symbols SCIP
1 import { addSectionFromProductCatalog } from "@account/js/tours/tour_utils";
2 import { registry } from "@web/core/registry";
3
4 registry.category("web_tour.tours").add('sale_catalog', {
5 steps: () => [
6 {
7 content: "Create a new SO",
8 trigger: '.o_list_button_add',
9 run: 'click',
10 },
11 {
12 content: "Select the customer field",
13 trigger: ".o_field_res_partner_many2one input.o_input",
14 run: 'click',
15 },
16 {
17 content: "Wait for the field to be active",
18 trigger: ".o_field_res_partner_many2one input[aria-expanded=true]",
19 },
20 {
21 content: "Select a customer from the dropdown",
22 trigger: ".o_field_res_partner_many2one .dropdown-item:not([id$='_loading']):first",
23 run: 'click',
24 },
25 {
26 content: "Open product catalog",
27 trigger: 'button[name="action_add_from_catalog"]',
28 run: 'click',
29 },
30 {
31 content: "Type 'Restricted' into the search bar",
32 trigger: 'input.o_searchview_input',
33 run: "edit Restricted",
34 },
35 {
36 content: "Search for the product",
37 trigger: 'input.o_searchview_input',
38 run: "press Enter",
39 },
40 {
41 content: "Wait for catalog rendering",
42 trigger: '.o_kanban_record:contains("Restricted Product")',
43 },
44 {
45 content: "Wait for filtering",
46 trigger: '.o_kanban_renderer:not(:has(.o_kanban_record:contains("AAA Product")))',
47 },
48 {
49 content: "Add the product to the SO",
50 trigger: '.o_kanban_record:contains("Restricted Product") .fa-shopping-cart',
51 run: 'click',
52 },
53 {
54 content: "Wait for product to be added",
55 trigger: '.o_kanban_record:contains("Restricted Product"):not(:has(.fa-shopping-cart))',
56 },
57 {
58 content: "Input a custom quantity",
59 trigger: '.o_kanban_record:contains("Restricted Product") .o_input',
60 run: "edit 6",
61 },
62 {
63 content: "Increase the quantity",
64 trigger: '.o_kanban_record:contains("Restricted Product") .fa-plus',
65 run: 'click',
66 },
67 {
68 content: "Close the catalog",
69 trigger: '.o-kanban-button-back',
70 run: 'click',
71 },
72 ]
73 });
74
75 registry.category("web_tour.tours").add('test_add_section_from_product_catalog_on_sale_order', {
76 steps: () => [
77 {
78 content: "Create a new SO",
79 trigger: '.o_list_button_add',
80 run: 'click',
81 },
82 {
83 content: "Select the customer field",
84 trigger: '.o_field_res_partner_many2one input.o_input',
85 run: 'click',
86 },
87 {
88 content: "Wait for the field to be active",
89 trigger: '.o_field_res_partner_many2one input[aria-expanded=true]',
90 },
91 {
92 content: "Select a customer from the dropdown",
93 trigger: '.o_field_res_partner_many2one .dropdown-item:not([id$="_loading"]):first',
94 run: 'click',
95 },
96 ...addSectionFromProductCatalog(),
97 ]
98 });