| 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 FloorScreen from "@pos_restaurant/../tests/tours/utils/floor_screen_util"; |
| 6 |
import * as TicketScreen from "@point_of_sale/../tests/pos/tours/utils/ticket_screen_util"; |
| 7 |
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 8 |
import { registry } from "@web/core/registry"; |
| 9 |
|
| 10 |
const { DateTime } = luxon; |
| 11 |
|
| 12 |
registry.category("web_tour.tours").add("PosResTicketScreenTour", { |
| 13 |
steps: () => |
| 14 |
[ |
| 15 |
Chrome.startPoS(), |
| 16 |
Dialog.confirm("Open Register"), |
| 17 |
// New Ticket button should not be in the ticket screen if no table is selected. |
| 18 |
Chrome.clickOrders(), |
| 19 |
Chrome.clickPlanButton(), |
| 20 |
|
| 21 |
// Make sure that order is deleted properly. |
| 22 |
FloorScreen.clickTable("5"), |
| 23 |
ProductScreen.addOrderline("Minute Maid", "1", "3"), |
| 24 |
ProductScreen.totalAmountIs("3.0"), |
| 25 |
Chrome.clickPlanButton(), |
| 26 |
FloorScreen.orderCountSyncedInTableIs("5", 0), |
| 27 |
Chrome.clickOrders(), |
| 28 |
TicketScreen.deleteOrder("001"), |
| 29 |
Dialog.confirm(), |
| 30 |
Chrome.clickPlanButton(), |
| 31 |
FloorScreen.isShown(), |
| 32 |
FloorScreen.clickTable("5"), |
| 33 |
ProductScreen.orderIsEmpty(), |
| 34 |
].flat(), |
| 35 |
}); |
| 36 |
|
| 37 |
registry.category("web_tour.tours").add("test_cancel_order_from_ui", { |
| 38 |
steps: () => |
| 39 |
[ |
| 40 |
Chrome.startPoS(), |
| 41 |
Dialog.confirm("Open Register"), |
| 42 |
FloorScreen.clickTable("5"), |
| 43 |
ProductScreen.isShown(), |
| 44 |
ProductScreen.addOrderline("Coca-Cola", "1", "3"), |
| 45 |
Chrome.clickPlanButton(), |
| 46 |
Chrome.isSynced(), |
| 47 |
FloorScreen.isShown(), |
| 48 |
FloorScreen.clickTable("5"), |
| 49 |
ProductScreen.clickReview(), |
| 50 |
ProductScreen.clickControlButton("Cancel Order"), |
| 51 |
Dialog.confirm(), |
| 52 |
FloorScreen.isShown(), |
| 53 |
Chrome.clickOrders(), |
| 54 |
TicketScreen.noOrderIsThere(), |
| 55 |
TicketScreen.selectFilter("Paid"), |
| 56 |
TicketScreen.noOrderIsThere(), |
| 57 |
Chrome.storedOrderCount(0), |
| 58 |
].flat(), |
| 59 |
}); |
| 60 |
|
| 61 |
registry.category("web_tour.tours").add("OrderNumberConflictTour", { |
| 62 |
steps: () => |
| 63 |
[ |
| 64 |
Chrome.startPoS(), |
| 65 |
FloorScreen.clickTable("3"), |
| 66 |
ProductScreen.isShown(), |
| 67 |
ProductScreen.addOrderline("Coca-Cola", "1", "3"), |
| 68 |
Chrome.clickPlanButton(), |
| 69 |
Chrome.clickOrders(), |
| 70 |
TicketScreen.nthRowContains(1, `${String(DateTime.now().year).slice(-2)}0`), |
| 71 |
TicketScreen.nthRowContains(1, "T 101"), |
| 72 |
TicketScreen.nthRowContains(2, `${String(DateTime.now().year).slice(-2)}1`), |
| 73 |
TicketScreen.nthRowContains(2, "T 103"), |
| 74 |
].flat(), |
| 75 |
}); |