| 1 |
import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util"; |
| 2 |
import * as CustomerDisplay from "@point_of_sale/../tests/customer_display/customer_display_utils"; |
| 3 |
import { registry } from "@web/core/registry"; |
| 4 |
|
| 5 |
registry.category("web_tour.tours").add("CustomerDisplayTourOnlinePayment", { |
| 6 |
steps: () => |
| 7 |
[ |
| 8 |
CustomerDisplay.addProduct(CustomerDisplay.ADD_PRODUCT_SELECTED, "add product"), |
| 9 |
Order.hasLine({ productName: "Letter Tray", price: "2,972.75" }), |
| 10 |
CustomerDisplay.amountIs("Total", "2,972.75"), |
| 11 |
CustomerDisplay.postMessage(CustomerDisplay.PAY_ONLINE, "pay with cash"), |
| 12 |
{ |
| 13 |
trigger: `.modal-content img[alt='QR Code to pay'][src='${CustomerDisplay.QR_URL}']`, |
| 14 |
}, |
| 15 |
CustomerDisplay.postMessage(CustomerDisplay.PAID, "payment approved"), |
| 16 |
CustomerDisplay.postMessage(CustomerDisplay.ORDER_IS_FINALIZED, "order is finalized"), |
| 17 |
{ |
| 18 |
content: "Check that we are now on the 'Thank you' screen", |
| 19 |
trigger: "div:contains('Thank you.')", |
| 20 |
run: "click", |
| 21 |
}, |
| 22 |
CustomerDisplay.postMessage(CustomerDisplay.NEW_ORDER, "new order"), |
| 23 |
{ |
| 24 |
trigger: "div:contains('Welcome.')", |
| 25 |
}, |
| 26 |
Order.doesNotHaveLine({}), |
| 27 |
CustomerDisplay.amountIs("Total", "0.00"), |
| 28 |
|
| 29 |
|
| 30 |
CustomerDisplay.postMessage(CustomerDisplay.ADD_PRODUCT_SELECTED, "add product"), |
| 31 |
Order.hasLine({ productName: "Letter Tray", price: "2,972.75" }), |
| 32 |
CustomerDisplay.amountIs("Total", "2,972.75"), |
| 33 |
CustomerDisplay.postMessage(CustomerDisplay.PAY_ONLINE, "pay with cash"), |
| 34 |
{ |
| 35 |
trigger: `.modal-content img[alt='QR Code to pay'][src='${CustomerDisplay.QR_URL}']`, |
| 36 |
}, |
| 37 |
].flat(), |
| 38 |
}); |