Debian Codegraph @

addons/pos_restaurant_loyalty/static/tests/tours/PosRestaurantLoyaltyTour.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 import * as FloorScreen from "@pos_restaurant/../tests/tours/utils/floor_screen_util";
4 import * as PosLoyalty from "@pos_loyalty/../tests/tours/utils/pos_loyalty_util";
5 import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
6 import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util";
7 import { registry } from "@web/core/registry";
8 const ProductScreen = { ...ProductScreenPos, ...ProductScreenResto };
9
10 registry.category("web_tour.tours").add("PosRestaurantRewardStay", {
11 steps: () =>
12 [
13 Chrome.startPoS(),
14 Dialog.confirm("Open Register"),
15 FloorScreen.clickTable("5"),
16 ProductScreen.clickDisplayedProduct("Water"),
17 PosLoyalty.hasRewardLine("10% on your order", "-0.22", "1"),
18 Chrome.clickPlanButton(),
19 Chrome.clickBtn("second floor"),
20 Chrome.clickBtn("main floor"),
21 FloorScreen.clickTable("5"),
22 PosLoyalty.hasRewardLine("10% on your order", "-0.22", "1"),
23 ].flat(),
24 });
25
26 registry.category("web_tour.tours").add("test_loyalty_reward_with_courses", {
27 steps: () =>
28 [
29 Chrome.startPoS(),
30 Dialog.confirm("Open Register"),
31 // Add product after selecting a course
32 FloorScreen.clickTable("5"),
33 ProductScreen.clickCourseButton(),
34 ProductScreen.clickDisplayedProduct("Water"),
35 PosLoyalty.hasRewardLine("10% on your order", "-0.22", "1"),
36 Chrome.clickPlanButton(),
37 // Add product before selecting a course
38 FloorScreen.clickTable("2"),
39 ProductScreen.clickDisplayedProduct("Water"),
40 PosLoyalty.hasRewardLine("10% on your order", "-0.22", "1"),
41 ProductScreen.clickCourseButton(),
42 PosLoyalty.hasRewardLine("10% on your order", "-0.22", "1"),
43 Chrome.clickPlanButton(),
44 ].flat(),
45 });