Debian Codegraph @

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

raw symbols SCIP
1 import { registry } from "@web/core/registry";
2 import { redirect } from "@web/core/utils/urls";
3
4 // This tour relies on data created on the Python test.
5 registry.category("web_tour.tours").add('sale_signature', {
6 url: '/my/quotes',
7 steps: () => [
8 {
9 content: "open the test SO",
10 trigger: 'a:text(test SO)',
11 run: "click",
12 expectUnloadPage: true,
13 },
14 {
15 content: "click sign",
16 trigger: 'a:contains("Sign")',
17 run: "click",
18 },
19 {
20 content: "clear the signature name",
21 trigger: '.modal .o_web_sign_name_and_signature input',
22 run: "clear",
23 },
24 {
25 content: "check submit is disabled when name is empty",
26 trigger: '.modal .o_portal_sign_submit:disabled',
27 },
28 {
29 content: "reset signature name",
30 trigger: '.modal .o_web_sign_name_and_signature input',
31 run: "fill Joel Willis",
32 },
33 {
34 content: "check submit is enabled",
35 trigger: '.o_portal_sign_submit:enabled',
36 },
37 {
38 trigger: ".modal .o_web_sign_name_and_signature input:value(Joel Willis)"
39 },
40 {
41 trigger: ".modal canvas.o_web_sign_signature",
42 run: "canvasNotEmpty",
43 },
44 {
45 content: "click select style",
46 trigger: '.modal .o_web_sign_auto_select_style button',
47 run: "click",
48 },
49 {
50 content: "click style 4",
51 trigger: ".o-dropdown-item:eq(3)",
52 run: "click",
53 },
54 {
55 content: "click submit",
56 trigger: '.modal .o_portal_sign_submit:enabled',
57 run: "click",
58 expectUnloadPage: true,
59 },
60 {
61 content: "check it's confirmed",
62 trigger: '#quote_content:contains("Thank You")',
63 run: "click",
64 }, {
65 trigger: '#quote_content',
66 run: function () {
67 redirect("/odoo");
68 }, // Avoid race condition at the end of the tour by returning to the home page.
69 expectUnloadPage: true,
70 },
71 {
72 trigger: 'nav',
73 }
74 ]});
75
76 registry.category("web_tour.tours").add("sale_signature_without_name", {
77 steps: () => [
78 {
79 content: "Wait for interactions to load",
80 trigger: `body[is-ready=true], :iframe body[is-ready=true]`,
81 },
82 {
83 content: "Sign & Pay",
84 trigger:
85 ".o_portal_sale_sidebar .btn-primary, :iframe .o_portal_sale_sidebar .btn-primary",
86 run: "click",
87 },
88 {
89 content: "click submit",
90 trigger: ".o_portal_sign_submit:enabled, :iframe .o_portal_sign_submit:enabled",
91 run: "click",
92 },
93 {
94 content: "check error because no name",
95 trigger:
96 '.o_portal_sign_error_msg:contains("Signature is missing."), :iframe .o_portal_sign_error_msg:contains("Signature is missing.")',
97 },
98 ],
99 });