Debian Codegraph @

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

raw
1 import * as ProductScreenPos from "@point_of_sale/../tests/pos/tours/utils/product_screen_util";
2 import * as ProductScreenResto from "@pos_restaurant/../tests/tours/utils/product_screen_util";
3 const ProductScreen = { ...ProductScreenPos, ...ProductScreenResto };
4 import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
5 import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util";
6 import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util";
7 import * as FloorScreen from "@pos_restaurant/../tests/tours/utils/floor_screen_util";
8 import * as TicketScreen from "@point_of_sale/../tests/pos/tours/utils/ticket_screen_util";
9 import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util";
10 import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util";
11 import { registry } from "@web/core/registry";
12 import { inLeftSide } from "@point_of_sale/../tests/pos/tours/utils/common";
13
14 registry.category("web_tour.tours").add("RefundStayCurrentTableTour", {
15 steps: () =>
16 [
17 Chrome.startPoS(),
18 Dialog.confirm("Open Register"),
19
20 // Create first order and pay it
21 FloorScreen.clickTable("2"),
22 ProductScreen.clickDisplayedProduct("Coca-Cola", true, "1"),
23 ProductScreen.clickDisplayedProduct("Coca-Cola", true, "2"),
24 ProductScreen.clickDisplayedProduct("Water", true, "1"),
25 ProductScreen.totalAmountIs("6.60"),
26 ProductScreen.clickPayButton(false),
27 ProductScreen.discardOrderWarningDialog(),
28 PaymentScreen.clickPaymentMethod("Cash"),
29 PaymentScreen.clickValidate(),
30 ReceiptScreen.clickNextOrder(),
31
32 // Go to another table and refund one of the products
33 FloorScreen.clickTable("4"),
34 ProductScreen.orderIsEmpty(),
35 ...ProductScreen.clickRefund(),
36 TicketScreen.selectOrder("001"),
37 Order.hasLine({
38 productName: "Coca-Cola",
39 }),
40 ProductScreen.clickNumpad("2"),
41 TicketScreen.toRefundTextContains("To Refund: 2"),
42 TicketScreen.confirmRefund(),
43 PaymentScreen.isShown(),
44 PaymentScreen.clickBack(),
45 ProductScreen.isShown(),
46 inLeftSide(ProductScreen.orderLineHas("Coca-Cola")),
47 ProductScreen.totalAmountIs("-4.40"),
48 ProductScreen.clickPayButton(),
49 PaymentScreen.clickPaymentMethod("Cash"),
50 PaymentScreen.clickValidate(),
51 ReceiptScreen.isShown(),
52 ].flat(),
53 });