| 1 |
import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util"; |
| 2 |
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 3 |
import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_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("OnlinePaymentErrorsTour", { |
| 8 |
steps: () => |
| 9 |
[ |
| 10 |
Chrome.startPoS(), |
| 11 |
Dialog.confirm("Open Register"), |
| 12 |
ProductScreen.addOrderline("Letter Tray", "10"), |
| 13 |
ProductScreen.selectedOrderlineHas("Letter Tray", "10"), |
| 14 |
ProductScreen.clickPayButton(), |
| 15 |
PaymentScreen.totalIs("48.0"), |
| 16 |
PaymentScreen.emptyPaymentlines("48.0"), |
| 17 |
|
| 18 |
PaymentScreen.clickPaymentMethod("Online payment"), |
| 19 |
PaymentScreen.selectedPaymentlineHas("Online payment", "48.0"), |
| 20 |
PaymentScreen.enterPaymentLineAmount("Online payment", "47"), |
| 21 |
PaymentScreen.selectedPaymentlineHas("Online payment", "47.0"), |
| 22 |
PaymentScreen.remainingIs("1.0"), |
| 23 |
PaymentScreen.validateButtonIsHighlighted(false), |
| 24 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 25 |
PaymentScreen.enterPaymentLineAmount("Cash", "2"), |
| 26 |
PaymentScreen.selectedPaymentlineHas("Cash", "2.0"), |
| 27 |
PaymentScreen.changeIs("1.0"), |
| 28 |
PaymentScreen.validateButtonIsHighlighted(true), |
| 29 |
PaymentScreen.clickValidate(), |
| 30 |
|
| 31 |
|
| 32 |
Dialog.confirm(), |
| 33 |
PaymentScreen.remainingIs("46.0"), |
| 34 |
PaymentScreen.clickPaymentMethod("Online payment", true, { amount: "46.0" }), |
| 35 |
PaymentScreen.clickPaymentMethod("Online payment", true, { |
| 36 |
amount: "0.0", |
| 37 |
remaining: "0.0", |
| 38 |
}), |
| 39 |
PaymentScreen.validateButtonIsHighlighted(true), |
| 40 |
PaymentScreen.clickValidate(), |
| 41 |
|
| 42 |
|
| 43 |
Dialog.confirm(), |
| 44 |
PaymentScreen.remainingIs("46.0"), |
| 45 |
PaymentScreen.clickPaymentMethod("Online payment", true, { amount: "46.0" }), |
| 46 |
PaymentScreen.clickPaymentMethod("Online payment"), |
| 47 |
PaymentScreen.clickPaymentline("Online payment", "0.0"), |
| 48 |
PaymentScreen.clickPaymentlineDelButton("Online payment", "0.0"), |
| 49 |
PaymentScreen.clickPaymentline("Cash", "2.0"), |
| 50 |
PaymentScreen.enterPaymentLineAmount("Cash", "3"), |
| 51 |
PaymentScreen.selectedPaymentlineHas("Cash", "3.0"), |
| 52 |
PaymentScreen.clickPaymentMethod("Online payment", true, { amount: "-1.0" }), |
| 53 |
PaymentScreen.remainingIs("0.0"), |
| 54 |
PaymentScreen.validateButtonIsHighlighted(true), |
| 55 |
PaymentScreen.clickValidate(), |
| 56 |
|
| 57 |
|
| 58 |
Dialog.confirm(), |
| 59 |
].flat(), |
| 60 |
}); |
| 61 |
|
| 62 |
registry.category("web_tour.tours").add("test_selected_customer_after_adding_payment_sync", { |
| 63 |
steps: () => |
| 64 |
[ |
| 65 |
Chrome.startPoS(), |
| 66 |
Dialog.confirm("Open Register"), |
| 67 |
ProductScreen.addOrderline("Letter Tray", "10"), |
| 68 |
ProductScreen.selectedOrderlineHas("Letter Tray", "10.0"), |
| 69 |
ProductScreen.clickPayButton(), |
| 70 |
PaymentScreen.totalIs("48.0"), |
| 71 |
PaymentScreen.emptyPaymentlines("48.0"), |
| 72 |
PaymentScreen.clickPaymentMethod("Online payment"), |
| 73 |
PaymentScreen.selectedPaymentlineHas("Online payment", "48.0"), |
| 74 |
PaymentScreen.clickPartnerButton(), |
| 75 |
PaymentScreen.clickCustomer("A simple PoS man!"), |
| 76 |
PaymentScreen.validateButtonIsHighlighted(true), |
| 77 |
PaymentScreen.clickValidate(), |
| 78 |
Dialog.is("Scan to Pay"), |
| 79 |
].flat(), |
| 80 |
}); |