Debian Codegraph @

addons/website_event_sale/static/tests/tours/website_event_sale.js

raw
1 import { registry } from "@web/core/registry";
2 import * as wsTourUtils from "@website_sale/js/tours/tour_utils";
3
4 registry.category("web_tour.tours").add("event_buy_tickets", {
5 url: "/event",
6 steps: () => [
7 {
8 content: "Go to the `Events` page",
9 trigger: 'a[href*="/event"]:contains("Conference for Architects TEST"):first',
10 run: "click",
11 expectUnloadPage: true,
12 },
13 {
14 content: "Open the register modal",
15 trigger: 'button:contains("Register")',
16 run: "click",
17 },
18 {
19 trigger: '#wrap:not(:has(a[href*="/event"]:contains("Conference for Architects")))',
20 },
21 {
22 content: "Try reaching maximum `Standard` ticket orderable",
23 trigger: ".modal input:eq(1)",
24 run: "edit 1234",
25 },
26 {
27 // The input number should be changed to EVENT_MAX_TICKETS without particular conditions (EVENT_MAX_TICKETS < 1234)
28 trigger: "div.o_wevent_ticket_selector:contains('Max.') input.form-control",
29 },
30 {
31 content: "Reset to 0",
32 trigger: ".modal input:eq(1)",
33 run: "edit 0"
34 },
35 {
36 content: "Add 1 unit of `Standard` ticket type thanks to the spinner",
37 trigger: "button[data-increment-type*='plus']",
38 run: "click",
39 },
40 {
41 content: "Try reaching maximum `VIP` ticket orderable",
42 trigger: ".modal input:eq(2)",
43 run: "edit 2002",
44 },
45 {
46 // The input number should be changed to min(limit per order, seats available) (11 < 12 < 2002)
47 trigger: "div.o_wevent_ticket_selector:contains('VIP'):contains('11') input.form-control",
48 },
49 {
50 content: "Edit 2 units of `VIP` ticket type",
51 trigger: ".modal input:eq(2)",
52 run: "edit 2",
53 },
54 {
55 content: "Click on `Order Now` button",
56 trigger: '.modal .btn-primary:contains("Register")',
57 run: "click",
58 },
59 {
60 content: "Wait the modal is shown before continue",
61 trigger: ".modal.modal_shown.show form[id=attendee_registration]",
62 },
63 {
64 trigger: ".modal#modal_attendees_registration input[name*='1-email']",
65 run: "edit [email protected]",
66 },
67 {
68 trigger: ".modal#modal_attendees_registration input[name*='1-phone']",
69 run: "edit 111 111",
70 },
71 {
72 trigger: ".modal#modal_attendees_registration input[name*='2-name']",
73 run: "edit Att2",
74 },
75 {
76 trigger: ".modal#modal_attendees_registration input[name*='2-phone']",
77 run: "edit 222 222",
78 },
79 {
80 trigger: ".modal#modal_attendees_registration input[name*='2-email']",
81 run: "edit [email protected]",
82 },
83 {
84 trigger: ".modal#modal_attendees_registration input[name*='1-name']",
85 run: "edit Att1",
86 },
87 {
88 trigger: ".modal#modal_attendees_registration input[name*='3-name']",
89 run: "edit Att3",
90 },
91 {
92 trigger: ".modal#modal_attendees_registration input[name*='3-phone']",
93 run: "edit 333 333",
94 },
95 {
96 trigger: ".modal#modal_attendees_registration input[name*='3-email']",
97 run: "edit [email protected]",
98 },
99 {
100 trigger:
101 ".modal#modal_attendees_registration input[name*='1-name'], .modal#modal_attendees_registration input[name*='2-name'], .modal#modal_attendees_registration input[name*='3-name']",
102 },
103 {
104 trigger: "input[name*='1-name'], input[name*='2-name'], input[name*='3-name']",
105 },
106 {
107 content: "Validate attendees details",
108 trigger: ".modal#modal_attendees_registration button[type=submit]",
109 run: "click",
110 expectUnloadPage: true,
111 },
112 {
113 trigger: ".oe_cart:contains(payment method)",
114 },
115 wsTourUtils.goToCart({ quantity: 3 }),
116 wsTourUtils.goToCheckout(),
117 ...wsTourUtils.assertCartAmounts({
118 untaxed: "4,000.00",
119 }),
120 ...wsTourUtils.payWithTransfer({ expectUnloadPage: true, waitFinalizeYourPayment: true }),
121 ],
122 });