| 1 |
import * as PosLoyalty from "@pos_loyalty/../tests/tours/utils/pos_loyalty_util"; |
| 2 |
import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util"; |
| 3 |
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 4 |
import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; |
| 5 |
import { registry } from "@web/core/registry"; |
| 6 |
|
| 7 |
registry.category("web_tour.tours").add("PosLoyaltyValidity1", { |
| 8 |
steps: () => |
| 9 |
[ |
| 10 |
// First tour should not get any automatic rewards |
| 11 |
|
| 12 |
Chrome.startPoS(), |
| 13 |
Dialog.confirm("Open Register"), |
| 14 |
|
| 15 |
// Not valid -> date |
| 16 |
ProductScreen.addOrderline("Whiteboard Pen", "5"), |
| 17 |
PosLoyalty.isRewardButtonHighlighted(false, true), |
| 18 |
PosLoyalty.orderTotalIs("16.00"), |
| 19 |
PosLoyalty.finalizeOrder("Cash", "16"), |
| 20 |
].flat(), |
| 21 |
}); |
| 22 |
|
| 23 |
registry.category("web_tour.tours").add("PosLoyaltyValidity2", { |
| 24 |
steps: () => |
| 25 |
[ |
| 26 |
// Second tour |
| 27 |
// Valid |
| 28 |
Chrome.startPoS(), |
| 29 |
ProductScreen.addOrderline("Whiteboard Pen", "5"), |
| 30 |
PosLoyalty.hasRewardLine("90% on the cheapest product", "-2.88"), |
| 31 |
PosLoyalty.finalizeOrder("Cash", "20"), |
| 32 |
|
| 33 |
// Not valid -> usage |
| 34 |
ProductScreen.addOrderline("Whiteboard Pen", "5"), |
| 35 |
PosLoyalty.isRewardButtonHighlighted(false, true), |
| 36 |
PosLoyalty.orderTotalIs("16.00"), |
| 37 |
PosLoyalty.finalizeOrder("Cash", "16.00"), |
| 38 |
].flat(), |
| 39 |
}); |