Debian Codegraph @

addons/website_event/static/tests/tours/tickets_questions.js

raw symbols SCIP
1 import { registry } from "@web/core/registry";
2 registry.category("web_tour.tours").add("test_tickets_questions", {
3 url: "/event",
4 steps: () => [
5 {
6 content: "Click on the Design Fair event",
7 trigger: 'article:contains("Design Fair New York")',
8 run: "click",
9 expectUnloadPage: true,
10 },
11 {
12 content: "Click on Register modal tickets button",
13 trigger: 'button:contains("Register")',
14 run: "click",
15 },
16 {
17 content: "Check Register button is disabled when no ticket selected",
18 trigger: 'button:disabled:contains("Register")',
19 },
20 {
21 content: "Check '-' spinner button is disabled when no ticket selected",
22 trigger: 'button[data-increment-type="minus"]:disabled',
23 },
24 {
25 content: "Try adding 53 'Free' tickets",
26 trigger: 'div.o_wevent_ticket_selector:contains("Free") input.form-control',
27 run: "edit 53",
28 },
29 {
30 content: "Check '+' spinner button is disabled when no ticket selected",
31 trigger: 'button[data-increment-type="plus"]:disabled',
32 },
33 {
34 // The input number should automatically be changed to the limit per order (22 < 28)
35 trigger: 'div.o_wevent_ticket_selector:contains("Free"):contains("22") input.form-control',
36 },
37 {
38 content: "Edit 2 'Free' tickets to buy",
39 trigger: 'div.o_wevent_ticket_selector:contains("Free") input.form-control',
40 run: "edit 2",
41 },
42 {
43 content: "Try adding 150 'Other' tickets",
44 trigger: 'div.o_wevent_ticket_selector:contains("Other") input.form-control',
45 run: "edit 150",
46 },
47 {
48 // The input number should automatically be changed to the event limit (28 < 150)
49 trigger: 'div.o_wevent_ticket_selector:contains("Other"):contains("28") input.form-control',
50 },
51 {
52 content: "Remove 'Other' tickets",
53 trigger: 'div.o_wevent_ticket_selector:contains("Other") input.form-control',
54 run: "edit 0",
55 },
56 {
57 content: "Check '-' spinner button is disabled when no ticket selected",
58 trigger: 'div.o_wevent_ticket_selector:contains("Other") button[data-increment-type="minus"]:disabled',
59 },
60 {
61 content: "Click on Register (to fill tickets data) button",
62 trigger: 'div.modal-footer button:contains("Register")',
63 run: "click",
64 },
65 {
66 content: "Wait the modal is shown before continue",
67 trigger: ".modal.modal_shown.show form[id=attendee_registration]",
68 },
69 {
70 trigger: 'div.o_wevent_registration_question_global select[name*="0-simple_choice"]',
71 run: "selectByLabel A friend",
72 },
73 {
74 trigger: 'div:contains("Ticket #1").modal-body input[name*="name"]',
75 run: "edit Attendee A",
76 },
77 {
78 trigger: 'div:contains("Ticket #1").modal-body input[name*="email"]',
79 run: "edit [email protected]",
80 },
81 {
82 trigger: 'div:contains("Ticket #1").modal-body input[name*="phone"]',
83 run: "edit +32499123456",
84 },
85 {
86 trigger: 'div:contains("Ticket #1").modal-body select[name*="1-simple_choice"]',
87 run: "selectByLabel Vegetarian",
88 },
89 {
90 trigger: 'div:contains("Ticket #1").modal-body textarea[name*="1-text_box"]',
91 run: "edit Fish and Nuts",
92 },
93 {
94 trigger: 'div:contains("Ticket #2").modal-body input[name*="name"]',
95 run: "edit Attendee B",
96 },
97 {
98 trigger: 'div:contains("Ticket #2").modal-body input[name*="email"]',
99 run: "edit [email protected]",
100 },
101 {
102 trigger: 'div:contains("Ticket #2").modal-body input[name*="company_name"]',
103 run: "edit My Company",
104 },
105 {
106 trigger: 'div:contains("Ticket #2").modal-body select[name*="2-simple_choice"]',
107 run: "selectByLabel Pastafarian",
108 },
109 {
110 trigger:
111 ".modal#modal_attendees_registration:not(.o_inactive_modal) button[type=submit].btn-primary",
112 run: "click",
113 expectUnloadPage: true,
114 },
115 {
116 // The tour stops too early and the registration fails if we don't wait the confirmation.
117 content: "Wait for confirmation",
118 trigger: ".o_wereg_confirmed, .oe_cart",
119 },
120 ],
121 });