Debian Codegraph @

addons/pos_restaurant/static/tests/tours/pos_restaurant_tour.js

raw symbols SCIP
1 import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util";
2 import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
3 import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util";
4 import * as ChromePos from "@point_of_sale/../tests/pos/tours/utils/chrome_util";
5 import * as ChromeRestaurant from "@pos_restaurant/../tests/tours/utils/chrome";
6 const Chrome = { ...ChromePos, ...ChromeRestaurant };
7 import * as FloorScreen from "@pos_restaurant/../tests/tours/utils/floor_screen_util";
8 import * as ProductScreenPos from "@point_of_sale/../tests/pos/tours/utils/product_screen_util";
9 import * as ProductScreenResto from "@pos_restaurant/../tests/tours/utils/product_screen_util";
10 import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util";
11 import * as TicketScreen from "@point_of_sale/../tests/pos/tours/utils/ticket_screen_util";
12 import * as combo from "@point_of_sale/../tests/pos/tours/utils/combo_popup_util";
13 import { inLeftSide } from "@point_of_sale/../tests/pos/tours/utils/common";
14 import { registry } from "@web/core/registry";
15 import * as Numpad from "@point_of_sale/../tests/generic_helpers/numpad_util";
16 import { delay } from "@web/core/utils/concurrency";
17 import * as TextInputPopup from "@point_of_sale/../tests/generic_helpers/text_input_popup_util";
18 import * as PreparationReceipt from "@point_of_sale/../tests/pos/tours/utils/preparation_receipt_util";
19 import * as NumberPopup from "@point_of_sale/../tests/generic_helpers/number_popup_util";
20 import { checkPreparationTicketData } from "@point_of_sale/../tests/pos/tours/utils/preparation_receipt_util";
21 import {
22 negate,
23 negateStep,
24 assertCurrentOrderDirty,
25 } from "@point_of_sale/../tests/generic_helpers/utils";
26 import * as FeedbackScreen from "@point_of_sale/../tests/pos/tours/utils/feedback_screen_util";
27 const ProductScreen = { ...ProductScreenPos, ...ProductScreenResto };
28
29 registry.category("web_tour.tours").add("pos_restaurant_sync", {
30 steps: () =>
31 [
32 Chrome.startPoS(),
33 Dialog.confirm("Open Register"),
34
35 // Create a floating order. The idea is to have one of the draft orders be a floating order during the tour.
36 FloorScreen.clickNewOrder(),
37
38 ProductScreen.clickDisplayedProduct("Coca-Cola"),
39 ProductScreen.clickDisplayedProduct("Coca-Cola"),
40 ProductScreen.clickDisplayedProduct("Coca-Cola"),
41 ProductScreen.setTab("Test"),
42 Chrome.clickPlanButton(),
43
44 // Create first order
45 FloorScreen.clickTable("5"),
46 Chrome.isTabActive("5"),
47 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
48 inLeftSide(Order.hasLine({ productName: "Coca-Cola", run: "dblclick" })),
49 ProductScreen.clickDisplayedProduct("Water", true),
50 ProductScreen.orderlineIsToOrder("Water"),
51 ProductScreen.orderlineIsToOrder("Coca-Cola"),
52 checkPreparationTicketData([
53 { name: "Coca-Cola", qty: 1 },
54 { name: "Water", qty: 1 },
55 ]),
56 ProductScreen.clickOrderButton(),
57 Chrome.closePrintingWarning(),
58 FloorScreen.clickTable("5"),
59 ProductScreen.orderlinesHaveNoChange(),
60 checkPreparationTicketData([]),
61 ProductScreen.totalAmountIs("4.40"),
62
63 // Create 2nd order (paid)
64 Chrome.clickPlanButton(),
65 FloorScreen.clickTable("2"),
66 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
67 ProductScreen.clickDisplayedProduct("Minute Maid", true),
68 ProductScreen.totalAmountIs("4.40"),
69 checkPreparationTicketData([
70 { name: "Coca-Cola", qty: 1 },
71 { name: "Minute Maid", qty: 1 },
72 ]),
73 ProductScreen.clickPayButton(false),
74 ProductScreen.discardOrderWarningDialog(),
75 PaymentScreen.clickPaymentMethod("Cash"),
76 PaymentScreen.clickValidate(),
77 ReceiptScreen.clickNextOrder(),
78
79 // order on another table with a product variant
80 FloorScreen.orderCountSyncedInTableIs("5", "0"),
81 FloorScreen.clickTable("4"),
82 ProductScreen.clickDisplayedProduct("Desk Organizer", false),
83 {
84 ...Dialog.confirm(),
85 content: "validate the variant dialog (with default values)",
86 },
87 ProductScreen.selectedOrderlineHas("Desk Organizer"),
88 checkPreparationTicketData([
89 { name: "Desk Organizer", qty: 1, attributes: ["S", "Leather"] },
90 ]),
91 ProductScreen.clickOrderButton(),
92 Chrome.closePrintingWarning(),
93 FloorScreen.clickTable("4"),
94 ProductScreen.orderlinesHaveNoChange(),
95 checkPreparationTicketData([]),
96 ProductScreen.totalAmountIs("5.87"),
97 ProductScreen.clickPayButton(),
98 PaymentScreen.clickPaymentMethod("Bank"),
99 PaymentScreen.clickValidate(),
100 ReceiptScreen.clickNextOrder(),
101
102 // After clicking next order, floor screen is shown.
103 // It should have 1 as number of draft synced order.
104 FloorScreen.orderCountSyncedInTableIs("5", "0"),
105 FloorScreen.clickTable("5"),
106 ProductScreen.totalAmountIs("4.40"),
107
108 // Create another draft order and go back to floor
109 Chrome.clickPlanButton(),
110 FloorScreen.clickTable("2"),
111 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
112 ProductScreen.clickDisplayedProduct("Minute Maid", true),
113 Chrome.clickPlanButton(),
114 FloorScreen.orderCountSyncedInTableIs("5", "0"),
115
116 // Delete the first order then go back to floor
117 Chrome.clickOrders(),
118 // The order ref ends with -00002 because it is actually the 2nd order made in the session.
119 // The first order made in the session is a floating order.
120 TicketScreen.deleteOrder("002"),
121 Dialog.confirm(),
122 Chrome.closePrintingWarning(),
123 Chrome.isSyncStatusConnected(),
124 TicketScreen.selectOrder("005"),
125 TicketScreen.loadSelectedOrder(),
126 ProductScreen.isShown(),
127 Chrome.clickPlanButton(),
128
129 // There should be 0 synced draft order as we already deleted -00002.
130 FloorScreen.clickTable("5"),
131 ProductScreen.orderIsEmpty(),
132 ].flat(),
133 });
134
135 /* pos_restaurant_sync_second_login
136 *
137 * This tour should be run after the first tour is done.
138 */
139 registry.category("web_tour.tours").add("pos_restaurant_sync_second_login", {
140 steps: () =>
141 [
142 // There is one draft synced order from the previous tour
143 Chrome.startPoS(),
144 FloorScreen.clickTable("2"),
145 Chrome.waitRequest(),
146 ProductScreen.isShown(),
147 {
148 trigger: ".pos-leftheader .badge:contains(2)",
149 },
150 ProductScreen.totalAmountIs("4.40"),
151
152 // Test transfering an order
153 ProductScreen.clickControlButton("Transfer"),
154 FloorScreen.orderCountSyncedInTableIs(2, 2),
155 FloorScreen.clickTable("4"),
156 Chrome.waitRequest(),
157 ProductScreen.isShown(),
158 {
159 trigger: ".pos-leftheader .badge:contains(4)",
160 },
161 Order.hasLine({
162 productName: "Coca-Cola",
163 quantity: 1,
164 withClass: ":eq(0)",
165 price: 2.2,
166 }),
167 Order.hasLine({
168 productName: "Minute Maid",
169 quantity: 1,
170 withClass: ":eq(1)",
171 price: 2.2,
172 }),
173
174 // Test if products still get merged after transfering the order
175 ProductScreen.clickDisplayedProduct("Coca-Cola"),
176 ProductScreen.totalAmountIs("6.60"),
177 ProductScreen.clickNumpad("1"),
178 ProductScreen.totalAmountIs("4.40"),
179 ProductScreen.clickPayButton(false),
180 ProductScreen.discardOrderWarningDialog(),
181 PaymentScreen.clickPaymentMethod("Cash"),
182 PaymentScreen.clickValidate(),
183 ReceiptScreen.clickNextOrder(),
184 // At this point, there are no draft orders.
185
186 FloorScreen.clickTable("2"),
187 ProductScreen.isShown(),
188 {
189 trigger: ".pos-leftheader .badge:contains(2)",
190 },
191 ProductScreen.orderIsEmpty(),
192 ProductScreen.clickControlButton("Transfer"),
193 FloorScreen.orderCountSyncedInTableIs(2, 0),
194 FloorScreen.orderCountSyncedInTableIs(4, 0),
195 FloorScreen.clickTable("4"),
196 Chrome.waitRequest(),
197 ProductScreen.isShown(),
198 {
199 trigger: ".pos-leftheader .badge:contains(4)",
200 },
201 ProductScreen.orderIsEmpty(),
202 ProductScreen.clickDisplayedProduct("Coca-Cola"),
203 ProductScreen.totalAmountIs("2.20"),
204 Chrome.clickPlanButton(),
205 FloorScreen.isShown(),
206 FloorScreen.orderCountSyncedInTableIs("4", "1"),
207 ].flat(),
208 });
209
210 registry.category("web_tour.tours").add("SaveLastPreparationChangesTour", {
211 steps: () =>
212 [
213 Chrome.startPoS(),
214 Dialog.confirm("Open Register"),
215 FloorScreen.clickTable("5"),
216 ProductScreen.clickDisplayedProduct("Coca-Cola", true, "1"),
217 ProductScreen.orderlineIsToOrder("Coca-Cola"),
218 ProductScreen.clickOrderButton(),
219 Chrome.closePrintingWarning(),
220 FloorScreen.clickTable("5"),
221 Chrome.waitRequest(),
222 ProductScreen.orderlinesHaveNoChange(),
223 Order.hasLine({
224 productName: "Coca-Cola",
225 quantity: 1,
226 withClass: ":eq(0)",
227 }),
228 Chrome.clickPlanButton(),
229 FloorScreen.hasTable("2"),
230 FloorScreen.hasTable("4"),
231 FloorScreen.hasTable("5"),
232 ].flat(),
233 });
234
235 registry.category("web_tour.tours").add("test_pos_restaurant_course", {
236 steps: () =>
237 [
238 Chrome.startPoS(),
239 Dialog.confirm("Open Register"),
240 FloorScreen.clickTable("5"),
241 ProductScreen.clickCourseButton(),
242 ProductScreen.clickDisplayedProduct("Coca-Cola"),
243 ProductScreen.clickCourseButton(),
244 ProductScreen.clickDisplayedProduct("Minute Maid"),
245 ProductScreen.clickCourseButton(),
246 ProductScreen.clickOrderButton(),
247 Chrome.closePrintingWarning(),
248 FloorScreen.clickTable("5"),
249 // Check only 2 courses are there and empty course gets removed on clicking Order button
250 {
251 trigger: negate('.order-course-name:eq(2) > span:contains("Course 3")'),
252 },
253 ProductScreen.fireCourseButtonHighlighted("Course 2"),
254 ProductScreen.payButtonNotHighlighted(),
255 ProductScreen.clickCourseButton(),
256 Chrome.clickPlanButton(),
257 FloorScreen.isShown(),
258 FloorScreen.clickTable("5"),
259 // Check only 2 courses are there and empty course gets removed on clicking Plan button
260 {
261 trigger: negate('.order-course-name:eq(2) > span:contains("Course 3")'),
262 },
263 // Check empty course gets remove after fire course.
264 ProductScreen.clickCourseButton(),
265 ProductScreen.selectCourseLine("Course 2"),
266 {
267 content: "Wait atleast 1 sec so that courses have different fired_date timestamps",
268 trigger: "body",
269 run: async () => await delay(1000),
270 },
271 ProductScreen.fireCourseButton(),
272 Chrome.closePrintingWarning(),
273 FloorScreen.clickTable("5"),
274 {
275 trigger: negate('.order-course-name:eq(2) > span:contains("Course 3")'),
276 },
277 ].flat(),
278 });
279
280 registry.category("web_tour.tours").add("OrderTrackingTour", {
281 steps: () =>
282 [
283 Chrome.startPoS(),
284 Dialog.confirm("Open Register"),
285 FloorScreen.clickTable("5"),
286 ProductScreen.clickDisplayedProduct("Coca-Cola"),
287 ProductScreen.clickDisplayedProduct("Coca-Cola", true, "2"),
288 Chrome.clickPlanButton(),
289 FloorScreen.clickTable("5"),
290 inLeftSide([
291 ...ProductScreen.clickLine("Coca-Cola", "2"),
292 ...ProductScreen.selectedOrderlineHasDirect("Coca-Cola", "2"),
293 ...["⌫", "1"].map(Numpad.click),
294 ...ProductScreen.selectedOrderlineHasDirect("Coca-Cola", "1"),
295 ]),
296 ProductScreen.clickPayButton(false),
297 ProductScreen.discardOrderWarningDialog(),
298 PaymentScreen.clickPaymentMethod("Bank"),
299 PaymentScreen.clickValidate(),
300 ReceiptScreen.isShown(),
301 ].flat(),
302 });
303 registry.category("web_tour.tours").add("CategLabelCheck", {
304 steps: () =>
305 [
306 Chrome.startPoS(),
307 Dialog.confirm("Open Register"),
308 FloorScreen.clickTable("5"),
309 ProductScreen.clickDisplayedProduct("Test Multi Category Product"),
310 ProductScreen.OrderButtonNotContain("Drinks"),
311 ].flat(),
312 });
313 registry.category("web_tour.tours").add("OrderChange", {
314 steps: () =>
315 [
316 Chrome.startPoS(),
317 Dialog.confirm("Open Register"),
318 FloorScreen.clickTable("5"),
319 ProductScreen.clickDisplayedProduct("Coca-Cola", true, "1"),
320 ProductScreen.clickOrderButton(),
321 Chrome.closePrintingWarning(),
322 FloorScreen.clickTable("5"),
323 ProductScreen.orderlinesHaveNoChange(),
324 ProductScreen.clickPayButton(),
325 PaymentScreen.clickPaymentMethod("Cash"),
326 PaymentScreen.clickNumpad("+10"),
327 PaymentScreen.clickValidate(),
328 ReceiptScreen.isShown(),
329 TicketScreen.receiptChangeIs("10"),
330 ].flat(),
331 });
332
333 registry.category("web_tour.tours").add("CrmTeamTour", {
334 steps: () =>
335 [
336 Chrome.startPoS(),
337 Dialog.confirm("Open Register"),
338 FloorScreen.clickTable("5"),
339 ProductScreen.clickDisplayedProduct("Coca-Cola"),
340 Chrome.clickPlanButton(),
341 FloorScreen.clickTable("5"),
342 Chrome.clickPlanButton(),
343 ].flat(),
344 });
345
346 registry.category("web_tour.tours").add("PoSPaymentSyncTour1", {
347 steps: () =>
348 [
349 Chrome.startPoS(),
350 Dialog.confirm("Open Register"),
351 FloorScreen.clickTable("5"),
352 ProductScreen.clickDisplayedProduct("Coca-Cola"),
353 ProductScreen.totalAmountIs("2.20"),
354 ProductScreen.clickPayButton(false),
355 ProductScreen.discardOrderWarningDialog(),
356 PaymentScreen.emptyPaymentlines("2.20"),
357 PaymentScreen.clickPaymentMethod("Bank"),
358 PaymentScreen.clickBackToProductScreen(),
359 ProductScreen.isShown(),
360 ProductScreen.clickOrderButton(),
361 Chrome.closePrintingWarning(),
362 ProductScreen.orderlinesHaveNoChange(),
363 Chrome.clickPlanButton(),
364 ].flat(),
365 });
366
367 registry.category("web_tour.tours").add("PoSPaymentSyncTour2", {
368 steps: () =>
369 [
370 Chrome.startPoS(),
371 FloorScreen.clickTable("5"),
372 PaymentScreen.isShown(),
373 PaymentScreen.clickBackToProductScreen(),
374 ProductScreen.isShown(),
375 ProductScreen.clickDisplayedProduct("Coca-Cola"),
376 ProductScreen.totalAmountIs("4.40"),
377 ProductScreen.clickPayButton(false),
378 ProductScreen.discardOrderWarningDialog(),
379 PaymentScreen.clickPaymentlineDelButton("Bank", "2.20"),
380 PaymentScreen.emptyPaymentlines("4.40"),
381 PaymentScreen.clickPaymentMethod("Bank"),
382 PaymentScreen.clickBackToProductScreen(),
383 ProductScreen.isShown(),
384 ProductScreen.clickOrderButton(),
385 Chrome.closePrintingWarning(),
386 ProductScreen.orderlinesHaveNoChange(),
387 Chrome.clickPlanButton(),
388 ].flat(),
389 });
390
391 registry.category("web_tour.tours").add("PoSPaymentSyncTour3", {
392 steps: () =>
393 [
394 Chrome.startPoS(),
395 FloorScreen.clickTable("5"),
396 PaymentScreen.isShown(),
397 PaymentScreen.clickBackToProductScreen(),
398 ProductScreen.isShown(),
399 ProductScreen.clickDisplayedProduct("Coca-Cola"),
400 ProductScreen.totalAmountIs("6.60"),
401 ProductScreen.clickPayButton(false),
402 ProductScreen.discardOrderWarningDialog(),
403 PaymentScreen.remainingIs("2.2"),
404 PaymentScreen.clickPaymentMethod("Bank"),
405 PaymentScreen.clickBackToProductScreen(),
406 ProductScreen.isShown(),
407 ProductScreen.clickOrderButton(),
408 Chrome.closePrintingWarning(),
409 ProductScreen.orderlinesHaveNoChange(),
410 Chrome.clickPlanButton(),
411 ].flat(),
412 });
413
414 registry.category("web_tour.tours").add("PreparationPrinterContent", {
415 steps: () =>
416 [
417 Chrome.startPoS(),
418 Dialog.confirm("Open Register"),
419 FloorScreen.clickTable("5"),
420 ProductScreen.clickControlButton("Guests"),
421 NumberPopup.enterValue("5"),
422 NumberPopup.isShown("5"),
423 Dialog.confirm(),
424 ProductScreen.clickDisplayedProduct("Product Test"),
425 Chrome.freezeDateTime(1739354400000), // 12 feb 2025 - 10:00
426 Dialog.confirm("Add"),
427 // Cutomer Note on orderline
428 ProductScreen.addCustomerNote("Test customer note - orderline"),
429 ProductScreen.totalAmountIs("10"),
430 checkPreparationTicketData([{ name: "Product Test", qty: 1, attribute: ["Value 1"] }], {
431 visibleInDom: [
432 "10:00",
433 "Value 1",
434 "Guest: 5",
435 "Eat in",
436 "Test customer note - orderline",
437 ],
438 invisibleInDom: ["DUPLICATA!"],
439 }),
440 ProductScreen.clickOrderButton(),
441 Chrome.closePrintingWarning(),
442 FloorScreen.clickTable("5"),
443 ProductScreen.clickLine("Product Test"),
444 ProductScreen.addCustomerNote("Updated customer note - orderline"),
445 checkPreparationTicketData([{ name: "Product Test", qty: 1, attribute: ["Value 1"] }], {
446 visibleInDom: ["NOTE UPDATE", "Updated customer note - orderline"],
447 }),
448 Chrome.clickPlanButton(),
449 FloorScreen.clickTable("2"),
450 ProductScreen.clickDisplayedProduct("Water"),
451 ...ProductScreen.clickSelectedLine("Water"),
452 ProductScreen.addInternalNote("To Serve"),
453 checkPreparationTicketData([{ name: "Water", qty: 1 }], {
454 visibleInDom: ["10:00", "To Serve"],
455 invisibleInDom: ["colorIndex"],
456 }),
457 Chrome.clickPlanButton(),
458 FloorScreen.clickTable("4"),
459 ProductScreen.clickDisplayedProduct("Water"),
460 ProductScreen.selectPreset("Eat in", "Takeaway"),
461 Chrome.presetTimingSlotHourNotExists("09:00"),
462 Chrome.selectPresetTimingSlotHour("12:00"),
463 checkPreparationTicketData([{ name: "Water", qty: 1 }], {
464 visibleInDom: ["12:00", "Takeaway"],
465 invisibleInDom: ["colorIndex"],
466 }),
467 ].flat(),
468 });
469
470 registry.category("web_tour.tours").add("test_course_restaurant_preparation_tour", {
471 steps: () =>
472 [
473 Chrome.startPoS(),
474 Dialog.confirm("Open Register"),
475 FloorScreen.clickTable("5"),
476 ProductScreen.clickCourseButton(),
477 ProductScreen.clickDisplayedProduct("Coca-Cola"),
478 ProductScreen.clickCourseButton(),
479 ProductScreen.clickDisplayedProduct("Water"),
480 ProductScreen.clickCourseButton(),
481 ProductScreen.clickDisplayedProduct("Minute Maid"),
482 checkPreparationTicketData(
483 [
484 { name: "Coca-Cola", qty: 1 },
485 { name: "Water", qty: 1 },
486 { name: "Minute Maid", qty: 1 },
487 ],
488 {
489 visibleInDom: ["Course 1", "Course 2", "Course 3"],
490 }
491 ),
492 ProductScreen.clickOrderButton(),
493 Dialog.bodyIs("Preparation Printer: The printer is not reachable."),
494 Dialog.confirm(),
495 FloorScreen.clickTable("5"),
496 checkPreparationTicketData([], {
497 visibleInDom: ["Course 2"],
498 fireCourse: true,
499 }),
500 ProductScreen.fireCourseButton(),
501 Dialog.bodyIs("Printer: The printer is not reachable."),
502 Dialog.confirm(),
503 FloorScreen.clickTable("5"),
504 ProductScreen.selectCourseLine("Course 3"),
505 checkPreparationTicketData([{ name: "Product Test", qty: 1, attribute: ["Value 1"] }], {
506 visibleInDom: ["Course 3"],
507 invisibleInDom: ["DUPLICATA!"],
508 fireCourse: true,
509 }),
510 ProductScreen.fireCourseButton(),
511 ].flat(),
512 });
513
514 registry.category("web_tour.tours").add("test_combo_preparation_receipt", {
515 steps: () =>
516 [
517 Chrome.startPoS(),
518 Dialog.confirm("Open Register"),
519 FloorScreen.clickTable("5"),
520 ProductScreen.clickDisplayedProduct("Office Combo"),
521 combo.select("Combo Product 2"),
522 combo.select("Combo Product 4"),
523 combo.select("Combo Product 6"),
524 Dialog.confirm(),
525 ProductScreen.clickDisplayedProduct("Office Combo"),
526 combo.select("Combo Product 1"),
527 combo.select("Combo Product 5"),
528 combo.select("Combo Product 8"),
529 Dialog.confirm(),
530 checkPreparationTicketData([
531 { name: "Office Combo", qty: 1 },
532 { name: "Combo Product 2", qty: 1 },
533 { name: "Combo Product 4", qty: 1 },
534 { name: "Combo Product 6", qty: 1 },
535 { name: "Office Combo", qty: 1 },
536 { name: "Combo Product 1", qty: 1 },
537 { name: "Combo Product 5", qty: 1 },
538 { name: "Combo Product 8", qty: 1 },
539 ]),
540 ProductScreen.totalAmountIs("95.00"),
541 ProductScreen.clickPayButton(false),
542 ProductScreen.discardOrderWarningDialog(),
543 ].flat(),
544 });
545
546 registry.category("web_tour.tours").add("MultiPreparationPrinter", {
547 steps: () =>
548 [
549 Chrome.startPoS(),
550 Dialog.confirm("Open Register"),
551 FloorScreen.clickTable("5"),
552 ProductScreen.clickDisplayedProduct("Product 1"),
553 ProductScreen.clickOrderButton(),
554 Dialog.bodyIs("Printer 2: The printer is not reachable."),
555 Dialog.confirm(),
556 ].flat(),
557 });
558
559 registry.category("web_tour.tours").add("LeaveResidualOrder", {
560 steps: () =>
561 [
562 Chrome.startPoS(),
563 Dialog.confirm("Open Register"),
564 FloorScreen.clickTable("5"),
565 ProductScreen.clickDisplayedProduct("Coca-Cola"),
566 ProductScreen.totalAmountIs("2.20"),
567 ProductScreen.clickPayButton(),
568 PaymentScreen.clickPaymentMethod("Bank"),
569 PaymentScreen.clickValidate(),
570 ReceiptScreen.clickNextOrder(),
571 FloorScreen.clickTable("5"),
572 ProductScreen.clickDisplayedProduct("Coca-Cola"),
573 Chrome.clickPlanButton(),
574 FloorScreen.hasTable("2"),
575 FloorScreen.hasTable("4"),
576 FloorScreen.hasTable("5"),
577 ].flat(),
578 });
579
580 registry.category("web_tour.tours").add("FinishResidualOrder", {
581 steps: () =>
582 [
583 Chrome.startPoS(),
584 FloorScreen.orderCountSyncedInTableIs("5", "0"),
585 FloorScreen.clickTable("5"),
586 Order.hasLine({
587 productName: "Coca-Cola",
588 quantity: 1,
589 withClass: ":eq(0)",
590 }),
591 ProductScreen.totalAmountIs("2.20"),
592 ProductScreen.clickPayButton(),
593 PaymentScreen.clickPaymentMethod("Bank"),
594 PaymentScreen.clickValidate(),
595 ReceiptScreen.clickNextOrder(),
596 ].flat(),
597 });
598
599 registry.category("web_tour.tours").add("test_multiple_preparation_printer_different_categories", {
600 steps: () =>
601 [
602 Chrome.startPoS(),
603 Dialog.confirm("Open Register"),
604 FloorScreen.clickTable("5"),
605 ProductScreen.clickDisplayedProduct("Product 1"),
606 ProductScreen.clickDisplayedProduct("Product 2"),
607 ProductScreen.clickOrderButton(),
608 Dialog.bodyIs("Printer 1: The printer is not reachable."),
609 Dialog.bodyIs("Printer 2: The printer is not reachable."),
610 Dialog.confirm(),
611 ].flat(),
612 });
613 registry.category("web_tour.tours").add("test_preset_delivery_restaurant", {
614 steps: () =>
615 [
616 Chrome.startPoS(),
617 Dialog.confirm("Open Register"),
618 Dialog.isNot(),
619 FloorScreen.clickTable("2"),
620 ProductScreen.clickCustomer("Partner Full"),
621 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
622 ProductScreen.clickControlButton("Cancel Order"),
623 Dialog.cancel({ title: "Existing orderlines" }),
624 Dialog.isNot(),
625 ProductScreen.isShown(),
626 ProductScreen.clickControlButton("Cancel Order"),
627 Dialog.confirm("ok"),
628 Dialog.isNot(),
629 FloorScreen.hasTable("2"),
630 ].flat(),
631 });
632
633 registry.category("web_tour.tours").add("test_preset_timing_restaurant", {
634 steps: () =>
635 [
636 Chrome.freezeDateTime(1749981600000), // June 15, 2025 - 10:00
637 Chrome.startPoS(),
638 FloorScreen.clickNewOrder(),
639 ProductScreen.clickDisplayedProduct("Coca-Cola"),
640 ProductScreen.selectPreset("Eat in", "Takeaway"),
641 TextInputPopup.inputText("John"),
642 Dialog.confirm("apply"),
643 Chrome.presetTimingSlotHourNotExists("09:00"),
644 Chrome.selectPresetTimingSlotHour("12:00"),
645 Chrome.clickPlanButton(),
646 FloorScreen.clickTable("4"),
647 ProductScreen.clickDisplayedProduct("Coca-Cola"),
648 Chrome.clickOrders(),
649 TicketScreen.nthRowContains(1, "John"),
650 TicketScreen.nthRowContains(1, "Takeaway", false),
651 TicketScreen.nthRowNotContains(1, "06/15/2025", false),
652 TicketScreen.nthRowContains(2, "002"),
653 TicketScreen.nthRowContains(2, "Eat in", false),
654 Chrome.clickPlanButton(),
655 FloorScreen.clickTable("5"),
656 ProductScreen.clickDisplayedProduct("Coca-Cola"),
657 ProductScreen.selectPreset("Eat in", "Takeaway"),
658 Chrome.selectPresetDateButton("06/16/2025"),
659 Chrome.presetTimingSlotHourExists("09:00"),
660 Chrome.selectPresetTimingSlotHour("11:00"),
661 Dialog.isNot(),
662 Chrome.clickOrders(),
663 TicketScreen.nthRowContains(3, "06/16/2025", false),
664 ].flat(),
665 });
666
667 registry.category("web_tour.tours").add("test_open_register_with_preset_takeaway", {
668 steps: () =>
669 [
670 Chrome.freezeDateTime(1749981600000), // June 15, 2025 - 10:00
671 Chrome.startPoS(),
672 FloorScreen.isShown(),
673 FloorScreen.clickTable("5"),
674 Chrome.presetTimingSlotHourNotExists("09:00"),
675 Chrome.selectPresetTimingSlotHour("12:20"),
676 Chrome.waitRequest(),
677 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
678 ProductScreen.clickControlButton("Cancel Order"),
679 Dialog.cancel({ title: "Existing orderlines" }),
680 Dialog.isNot({ title: "Existing orderlines" }),
681 ProductScreen.clickControlButton("Cancel Order"),
682 Dialog.confirm("ok"),
683 Dialog.isNot({ title: "Existing orderlines" }),
684 FloorScreen.isShown(),
685 Chrome.clickOrders(),
686 {
687 trigger: ".orders:contains(no orders found)",
688 },
689 ].flat(),
690 });
691
692 registry.category("web_tour.tours").add("RestaurantPresetEatInTour", {
693 steps: () =>
694 [
695 Chrome.startPoS(),
696 Dialog.confirm("Open Register"),
697 FloorScreen.clickTable("4"),
698 ProductScreen.clickDisplayedProduct("Coca-Cola", true),
699 ProductScreen.clickPayButton(false),
700 ProductScreen.discardOrderWarningDialog(),
701 PaymentScreen.clickPaymentMethod("Cash"),
702 PaymentScreen.clickValidate(),
703 ReceiptScreen.cashierNameExists("test_user"),
704 ].flat(),
705 });
706
707 registry.category("web_tour.tours").add("test_combo_preparation_receipt_layout", {
708 steps: () =>
709 [
710 Chrome.startPoS(),
711 Dialog.confirm("Open Register"),
712 FloorScreen.clickTable("5"),
713 ProductScreen.clickDisplayedProduct("Office Combo"),
714 combo.select("Combo Product 2"),
715 combo.select("Combo Product 4"),
716 combo.select("Combo Product 6"),
717 Dialog.confirm(),
718 checkPreparationTicketData([
719 { name: "Office Combo", qty: 1 },
720 { name: "Combo Product 2", qty: 1 },
721 { name: "Combo Product 4", qty: 1 },
722 { name: "Combo Product 6", qty: 1 },
723 ]),
724 ].flat(),
725 });
726
727 registry.category("web_tour.tours").add("test_customer_alone_saved", {
728 steps: () =>
729 [
730 Chrome.startPoS(),
731 Dialog.confirm("Open Register"),
732 FloorScreen.clickTable("5"),
733 ProductScreen.clickDisplayedProduct("Coca-Cola"),
734 Chrome.clickOrders(),
735 Chrome.clickRegister(),
736 ProductScreen.clickPartnerButton(),
737 ProductScreen.clickCustomer("Acme Corporation"),
738 Chrome.clickOrders(),
739 Chrome.clickRegister(),
740 ProductScreen.customerIsSelected("Acme Corporation"),
741 ].flat(),
742 });
743
744 registry.category("web_tour.tours").add("test_open_default_register_screen_config", {
745 steps: () =>
746 [
747 Chrome.startPoS(),
748 Dialog.confirm("Open Register"),
749 ProductScreen.clickDisplayedProduct("Coca-Cola"),
750 Chrome.endTour(),
751 ].flat(),
752 });
753
754 registry
755 .category("web_tour.tours")
756 .add(
757 "test_fast_payment_validation_from_restaurant_product_screen_with_automatic_receipt_printing",
758 {
759 steps: () =>
760 [
761 Chrome.startPoS(),
762 Dialog.confirm("Open Register"),
763 FloorScreen.clickTable("2"),
764 ProductScreen.clickDisplayedProduct("Coca-Cola"),
765 {
766 content: "Check the content of the preparation receipt",
767 trigger: "body",
768 run: async () => {
769 const receipts = await PreparationReceipt.generatePreparationReceipts();
770 if (!receipts[0].innerHTML.includes("Coca-Cola")) {
771 throw new Error("Coca-Cola not found in printed receipt");
772 }
773 if (!receipts[0].innerHTML.includes("NEW")) {
774 throw new Error("NEW not found in printed receipt");
775 }
776 },
777 },
778 ProductScreen.clickFastPaymentButton("Bank"),
779 Dialog.discard(),
780 FeedbackScreen.isShown(),
781 Dialog.confirm(),
782 FeedbackScreen.clickScreen(),
783 FloorScreen.isShown(),
784 FloorScreen.clickTable("2"),
785 ProductScreen.clickDisplayedProduct("Coca-Cola"),
786 {
787 content: "Check the content of the preparation receipt",
788 trigger: "body",
789 run: async () => {
790 const receipts = await PreparationReceipt.generatePreparationReceipts();
791 if (!receipts[0].innerHTML.includes("Coca-Cola")) {
792 throw new Error("Coca-Cola not found in printed receipt");
793 }
794 if (!receipts[0].innerHTML.includes("NEW")) {
795 throw new Error("NEW not found in printed receipt");
796 }
797 },
798 },
799 ProductScreen.clickPayButton(false),
800 ProductScreen.discardOrderWarningDialog(),
801 PaymentScreen.clickPaymentMethod("Bank"),
802 PaymentScreen.clickValidate(),
803 FeedbackScreen.isShown(),
804 Dialog.confirm(),
805 FeedbackScreen.clickScreen(),
806 FloorScreen.isShown(),
807 ].flat(),
808 }
809 );
810
811 registry
812 .category("web_tour.tours")
813 .add(
814 "test_fast_payment_validation_from_restaurant_product_screen_without_automatic_receipt_printing",
815 {
816 steps: () =>
817 [
818 Chrome.startPoS(),
819 Dialog.confirm("Open Register"),
820 FloorScreen.clickTable("2"),
821 ProductScreen.clickDisplayedProduct("Coca-Cola"),
822 {
823 content: "Check the content of the preparation receipt",
824 trigger: "body",
825 run: async () => {
826 const receipts = await PreparationReceipt.generatePreparationReceipts();
827 if (!receipts[0].innerHTML.includes("Coca-Cola")) {
828 throw new Error("Coca-Cola not found in printed receipt");
829 }
830 if (!receipts[0].innerHTML.includes("NEW")) {
831 throw new Error("NEW not found in printed receipt");
832 }
833 },
834 },
835 ProductScreen.clickFastPaymentButton("Bank"),
836 Dialog.discard(),
837 ReceiptScreen.isShown(),
838 ReceiptScreen.clickNextOrder(),
839 FloorScreen.isShown(),
840 FloorScreen.clickTable("2"),
841 ProductScreen.clickDisplayedProduct("Coca-Cola"),
842 {
843 content: "Check the content of the preparation receipt",
844 trigger: "body",
845 run: async () => {
846 const receipts = await PreparationReceipt.generatePreparationReceipts();
847 if (!receipts[0].innerHTML.includes("Coca-Cola")) {
848 throw new Error("Coca-Cola not found in printed receipt");
849 }
850 if (!receipts[0].innerHTML.includes("NEW")) {
851 throw new Error("NEW not found in printed receipt");
852 }
853 },
854 },
855 ProductScreen.clickPayButton(false),
856 ProductScreen.discardOrderWarningDialog(),
857 PaymentScreen.clickPaymentMethod("Bank"),
858 PaymentScreen.clickValidate(),
859 ReceiptScreen.isShown(),
860 ReceiptScreen.clickNextOrder(),
861 FloorScreen.isShown(),
862 ].flat(),
863 }
864 );
865
866 registry.category("web_tour.tours").add("test_transfering_orders", {
867 steps: () =>
868 [
869 Chrome.startPoS(),
870 Dialog.confirm("Open Register"),
871
872 // Create a floating order with 3 cola
873 FloorScreen.clickNewOrder(),
874 ProductScreen.clickDisplayedProduct("Coca-Cola"),
875 ProductScreen.clickDisplayedProduct("Coca-Cola"),
876 ProductScreen.clickDisplayedProduct("Coca-Cola"),
877 ProductScreen.setTab("Cola"),
878 Chrome.clickPlanButton(),
879
880 // Create a floating order with 3 water
881 FloorScreen.clickNewOrder(),
882 ProductScreen.clickDisplayedProduct("Water"),
883 ProductScreen.clickDisplayedProduct("Water"),
884 ProductScreen.clickDisplayedProduct("Water"),
885 ProductScreen.setTab("Water"),
886 Chrome.clickPlanButton(),
887
888 // Create an order on table 5 with 3 minute maid
889 FloorScreen.clickTable("5"),
890 ProductScreen.clickDisplayedProduct("Minute Maid"),
891 ProductScreen.clickDisplayedProduct("Minute Maid"),
892 ProductScreen.clickDisplayedProduct("Minute Maid"),
893 Chrome.clickPlanButton(),
894
895 // Create an order on table 4 with 3 coca-cola
896 FloorScreen.clickTable("4"),
897 ProductScreen.clickDisplayedProduct("Coca-Cola"),
898 ProductScreen.clickDisplayedProduct("Coca-Cola"),
899 ProductScreen.clickDisplayedProduct("Coca-Cola"),
900 Chrome.clickPlanButton(),
901
902 // Should have 4 orders
903 Chrome.clickOrders(),
904 TicketScreen.nbOrdersIs(4),
905
906 // Transfer floating order to another floating order
907 TicketScreen.selectOrder("Cola"),
908 TicketScreen.loadSelectedOrder(),
909 ProductScreen.clickControlButton("Transfer"),
910 Chrome.clickOrders(),
911 TicketScreen.selectOrder("Water"),
912 ProductScreen.isShown(),
913 ProductScreen.clickLine("Coca-Cola", "3"),
914 ProductScreen.clickLine("Water", "3"),
915 Chrome.clickOrders(),
916 TicketScreen.nbOrdersIs(3),
917
918 // Transfering order from table 5 to table 4
919 Chrome.clickPlanButton(),
920 FloorScreen.clickTable("5"),
921 ProductScreen.clickControlButton("Transfer"),
922 FloorScreen.clickTable("4"),
923 ProductScreen.clickLine("Minute Maid", "3"),
924 ProductScreen.clickLine("Coca-Cola", "3"),
925 Chrome.clickOrders(),
926 TicketScreen.nbOrdersIs(2),
927
928 // Transfering order from table to floating order
929 Chrome.clickPlanButton(),
930 FloorScreen.clickTable("4"),
931 ProductScreen.clickControlButton("Transfer"),
932 Chrome.clickOrders(),
933 TicketScreen.selectOrder("Water"),
934 ProductScreen.isShown(),
935 ProductScreen.clickLine("Coca-Cola", "6"),
936 ProductScreen.clickLine("Water", "3"),
937 ProductScreen.clickLine("Minute Maid", "3"),
938 Chrome.clickOrders(),
939 TicketScreen.nbOrdersIs(1),
940
941 // Transfering floating order to empty table
942 TicketScreen.selectOrder("Water"),
943 TicketScreen.loadSelectedOrder(),
944 ProductScreen.clickControlButton("Transfer"),
945 FloorScreen.clickTable("5"),
946 ProductScreen.clickLine("Coca-Cola", "6"),
947 ProductScreen.clickLine("Water", "3"),
948 ProductScreen.clickLine("Minute Maid", "3"),
949 Chrome.clickPlanButton(),
950 FloorScreen.orderCountSyncedInTableIs("5", "1"),
951
952 // Create a new floating order and transfer it to filled table
953 FloorScreen.clickNewOrder(),
954 ProductScreen.clickDisplayedProduct("Water"),
955 ProductScreen.setTab("Water2"),
956 Chrome.clickPlanButton(),
957 Chrome.clickOrders(),
958 TicketScreen.selectOrder("Water2"),
959 TicketScreen.loadSelectedOrder(),
960 ProductScreen.clickControlButton("Transfer"),
961 FloorScreen.clickTable("5"),
962 ProductScreen.clickLine("Water", "4"),
963 ProductScreen.clickLine("Coca-Cola", "6"),
964 ProductScreen.clickLine("Minute Maid", "3"),
965 Chrome.clickOrders(),
966 TicketScreen.nbOrdersIs(1),
967 ].flat(),
968 });
969 registry.category("web_tour.tours").add("test_direct_sales", {
970 steps: () =>
971 [
972 Chrome.startPoS(),
973 Dialog.confirm("Open Register"),
974 FloorScreen.clickNewOrder(),
975 ProductScreen.clickDisplayedProduct("Coca-Cola"),
976 ProductScreen.clickDisplayedProduct("Water"),
977 ProductScreen.totalAmountIs("4.40"),
978 ProductScreen.clickPayButton(false),
979 ProductScreen.discardOrderWarningDialog(),
980 PaymentScreen.clickPaymentMethod("Cash"),
981 PaymentScreen.syncCurrentOrder(),
982 PaymentScreen.clickValidate(),
983
984 Chrome.clickPlanButton(),
985 FloorScreen.clickNewOrder(),
986 ProductScreen.clickDisplayedProduct("Coca-Cola"),
987 ProductScreen.setTab("Test"),
988 ProductScreen.clickDisplayedProduct("Water"),
989 ProductScreen.totalAmountIs("4.40"),
990 ProductScreen.clickPayButton(false),
991 ProductScreen.discardOrderWarningDialog(),
992 PaymentScreen.clickPaymentMethod("Cash"),
993 PaymentScreen.syncCurrentOrder(),
994 PaymentScreen.clickValidate(),
995
996 Chrome.clickPlanButton(),
997 FloorScreen.clickTable("5"),
998 ProductScreen.clickDisplayedProduct("Coca-Cola"),
999 ProductScreen.clickDisplayedProduct("Water"),
1000 ProductScreen.totalAmountIs("4.40"),
1001 ProductScreen.clickPayButton(false),
1002 ProductScreen.discardOrderWarningDialog(),
1003 PaymentScreen.clickPaymentMethod("Cash"),
1004 PaymentScreen.syncCurrentOrder(),
1005 PaymentScreen.clickValidate(),
1006 ].flat(),
1007 });
1008
1009 registry.category("web_tour.tours").add("test_sync_lines_qty_update", {
1010 steps: () =>
1011 [
1012 Chrome.startPoS(),
1013 Dialog.confirm("Open Register"),
1014 FloorScreen.clickTable("5"),
1015 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1016 Order.hasLine({ productName: "Coca-Cola" }),
1017 Chrome.clickPlanButton(),
1018 FloorScreen.clickTable("5"),
1019 ProductScreen.clickLine("Coca-Cola"),
1020 Chrome.waitRequest(), // Wait for sync request (the order is created)
1021 assertCurrentOrderDirty(false),
1022 Numpad.click("3"),
1023 Order.hasLine({ productName: "Coca-Cola", quantity: 3 }),
1024 assertCurrentOrderDirty(true),
1025 Chrome.clickPlanButton(),
1026 FloorScreen.isShown(),
1027 Chrome.waitRequest(), // Wait for sync request
1028 FloorScreen.clickTable("5"),
1029 ProductScreen.isShown(),
1030 assertCurrentOrderDirty(false),
1031 ].flat(),
1032 });
1033
1034 registry.category("web_tour.tours").add("test_sync_set_partner", {
1035 steps: () =>
1036 [
1037 Chrome.startPoS(),
1038 Dialog.confirm("Open Register"),
1039 FloorScreen.clickTable("5"),
1040 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1041 Order.hasLine({ productName: "Coca-Cola" }),
1042 Chrome.clickPlanButton(),
1043 FloorScreen.clickTable("5"),
1044 Chrome.waitRequest(), // Wait for sync request
1045 assertCurrentOrderDirty(false),
1046 ProductScreen.clickPartnerButton(),
1047 ProductScreen.clickCustomer("Acme Corporation"),
1048 assertCurrentOrderDirty(true),
1049 Chrome.clickPlanButton(),
1050 FloorScreen.isShown(),
1051 Chrome.waitRequest(), // Wait for sync request
1052 ].flat(),
1053 });
1054
1055 registry.category("web_tour.tours").add("test_sync_set_note", {
1056 steps: () =>
1057 [
1058 Chrome.startPoS(),
1059 Dialog.confirm("Open Register"),
1060 FloorScreen.clickTable("5"),
1061 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1062 Order.hasLine({ productName: "Coca-Cola" }),
1063 Chrome.clickPlanButton(),
1064 FloorScreen.clickTable("5"),
1065 Chrome.waitRequest(), // Wait for sync request
1066 assertCurrentOrderDirty(false),
1067 ProductScreen.isShown(),
1068 ProductScreen.addInternalNote("Hello world"),
1069 assertCurrentOrderDirty(true),
1070 Chrome.clickPlanButton(),
1071 FloorScreen.isShown(),
1072 Chrome.waitRequest(), // Wait for sync request
1073 ].flat(),
1074 });
1075
1076 registry.category("web_tour.tours").add("test_sync_set_line_note", {
1077 steps: () =>
1078 [
1079 Chrome.startPoS(),
1080 Dialog.confirm("Open Register"),
1081 FloorScreen.clickTable("5"),
1082 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1083 Order.hasLine({ productName: "Coca-Cola" }),
1084 Chrome.clickPlanButton(),
1085 FloorScreen.clickTable("5"),
1086 Chrome.waitRequest(), // Wait for sync request
1087 assertCurrentOrderDirty(false),
1088 ProductScreen.isShown(),
1089 ProductScreen.clickLine("Coca-Cola"),
1090 ProductScreen.addInternalNote("Demo note"),
1091 assertCurrentOrderDirty(true),
1092 Chrome.clickPlanButton(),
1093 FloorScreen.isShown(),
1094 Chrome.waitRequest(), // Wait for sync request
1095 ].flat(),
1096 });
1097
1098 registry.category("web_tour.tours").add("test_sync_set_pricelist", {
1099 steps: () =>
1100 [
1101 Chrome.startPoS(),
1102 Dialog.confirm("Open Register"),
1103 FloorScreen.clickTable("5"),
1104 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1105 Order.hasLine({ productName: "Coca-Cola" }),
1106 Chrome.clickPlanButton(),
1107 FloorScreen.clickTable("5"),
1108 Chrome.waitRequest(), // Wait for sync request
1109 assertCurrentOrderDirty(false),
1110 ProductScreen.isShown(),
1111 ProductScreen.clickLine("Coca-Cola"),
1112 ProductScreen.clickPriceList("Second Pricelist"),
1113 assertCurrentOrderDirty(true),
1114 Chrome.clickPlanButton(),
1115 FloorScreen.isShown(),
1116 Chrome.waitRequest(), // Wait for sync request
1117 ].flat(),
1118 });
1119
1120 registry.category("web_tour.tours").add("test_delete_line_release_table", {
1121 steps: () =>
1122 [
1123 Chrome.startPoS(),
1124 Dialog.confirm("Open Register"),
1125 FloorScreen.clickTable("5"),
1126 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1127 Order.hasLine({ productName: "Coca-Cola" }),
1128 Chrome.clickPlanButton(),
1129 FloorScreen.clickTable("5"),
1130 ProductScreen.clickLine("Coca-Cola"),
1131 ProductScreen.selectedOrderlineHasDirect("Coca-Cola"),
1132 ...["⌫", "⌫"].map(Numpad.click),
1133 ProductScreen.releaseTable(),
1134 FloorScreen.clickTable("5"),
1135 Chrome.waitRequest(),
1136 negateStep(...Order.hasLine({ productName: "Coca-Cola" })),
1137 ].flat(),
1138 });
1139
1140 registry.category("web_tour.tours").add("test_combo_synchronisation", {
1141 steps: () =>
1142 [
1143 Chrome.startPoS(),
1144 Dialog.confirm("Open Register"),
1145 FloorScreen.clickTable("5"),
1146 ProductScreen.clickDisplayedProduct("Office Combo"),
1147 combo.select("Combo Product 2"),
1148 combo.select("Combo Product 4"),
1149 combo.select("Combo Product 6"),
1150 Dialog.confirm(),
1151 Chrome.clickPlanButton(),
1152 FloorScreen.clickTable("5"),
1153 ProductScreen.clickPartnerButton(),
1154 ProductScreen.clickCustomer("A"),
1155 Chrome.clickPlanButton(),
1156 FloorScreen.hasTable("5"),
1157 FloorScreen.clickTable("5"),
1158 {
1159 content: "Check if there still has combo lines",
1160 trigger: ".orderline-combo",
1161 },
1162 ProductScreen.addCourse(),
1163 ProductScreen.clickOrderline("Combo Product 2"),
1164 ProductScreen.transferCourseTo("Course 2"),
1165 {
1166 content: "Check if entire combo is transfered to course 2",
1167 trigger: ".pos", // dummy trigger
1168 run: function () {
1169 const onlyCourse2 = window.posmodel
1170 .getOrder()
1171 .lines.every((x) => x.course_id.name === "Course 2");
1172
1173 if (!onlyCourse2) {
1174 throw new Error("The entire combo must be transferred to Course 2.");
1175 }
1176 },
1177 },
1178 ].flat(),
1179 });
1180
1181 registry.category("web_tour.tours").add("test_guest_count_bank_payment", {
1182 steps: () =>
1183 [
1184 Chrome.startPoS(),
1185 FloorScreen.clickTable("2"),
1186 NumberPopup.enterValue("5"),
1187 NumberPopup.isShown("5"),
1188 Dialog.confirm(),
1189 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1190 Order.hasLine({ productName: "Coca-Cola" }),
1191 ProductScreen.clickPayButton(false),
1192 ProductScreen.confirmOrderWarningDialog(),
1193 PaymentScreen.clickPaymentMethod("Bank"),
1194 PaymentScreen.clickBackToProductScreen(),
1195 ProductScreen.isShown(),
1196 ].flat(),
1197 });
1198
1199 registry.category("web_tour.tours").add("test_name_preset_skip_screen", {
1200 steps: () =>
1201 [
1202 Chrome.startPoS(),
1203 Dialog.confirm("Open Register"),
1204 FloorScreen.clickTable("5"),
1205 ProductScreen.clickDisplayedProduct("Coca-Cola"),
1206 ProductScreen.clickPartnerButton(),
1207 ProductScreen.clickCustomer("Acme Corporation"),
1208 ProductScreen.clickPayButton(false),
1209 ProductScreen.discardOrderWarningDialog(),
1210 PaymentScreen.clickPaymentMethod("Cash"),
1211 PaymentScreen.clickValidate(),
1212 ReceiptScreen.clickNextOrder(),
1213 ].flat(),
1214 });