| 1 | import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 2 | import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; |
| 3 | import { registry } from "@web/core/registry"; |
| 4 | |
| 5 | registry.category("web_tour.tours").add("customer_display_shows_qr_popup", { |
| 6 | steps: () => |
| 7 | [ |
| 8 | Chrome.startPoS(), |
| 9 | Dialog.confirm("Open Register"), |
| 10 | Chrome.waitForMenuButtons(), |
| 11 | Chrome.clickMenuButton(), |
| 12 | Chrome.waitForMenuOptionsToOpen(), |
| 13 | Chrome.ClickOnCustomerDisplayButton(), |
| 14 | Chrome.CustomerDisplayHasThisDeviceButton(), |
| 15 | Chrome.CustomerDisplayHasQRButton(), |
| 16 | Chrome.ClickCustomerDisplayQRButton(), |
| 17 | Chrome.CustomerDisplayQRIsDisplayed(), |
| 18 | { |
| 19 | isActive: ["mobile"], |
| 20 | content: "Check that the Customer display url is valid", |
| 21 | trigger: ".o-overlay-item .modal .modal-body .small a", |
| 22 | run: function (el) { |
| 23 | const url = el.anchor.href; |
| 24 | if (!url || url.includes("undefined")) { |
| 25 | throw new Error( |
| 26 | `Invalid customer display URL (contains undefined): ${url}` |
| 27 | ); |
| 28 | } |
| 29 | try { |
| 30 | new URL(url); |
| 31 | } catch { |
| 32 | throw new Error(`Invalid customer display URL: ${url}`); |
| 33 | } |
| 34 | }, |
| 35 | }, |
| 36 | ].flat(), |
| 37 | }); |