| 1 | import { registry } from "@web/core/registry"; |
| 2 | |
| 3 | function logText(displayText) { |
| 4 | console.log( |
| 5 | "\n\n┏" + "━".repeat(displayText.length) + "┓", |
| 6 | `\n┃${displayText}┃`, |
| 7 | "\n┗" + "━".repeat(displayText.length) + "┛\n" |
| 8 | ); |
| 9 | } |
| 10 | |
| 11 | registry.category("web_tour.tours").add("tourSessionOpenProductPerformance", { |
| 12 | steps: () => |
| 13 | [ |
| 14 | { |
| 15 | trigger: "body", |
| 16 | timeout: 25000, |
| 17 | async run({ waitFor }) { |
| 18 | await waitFor("body:not(:has(.pos-loader))", { timeout: 20000 }); |
| 19 | const startTime = performance.timeOrigin; |
| 20 | const endTime = Date.now(); |
| 21 | const loadingTimeSec = (endTime - startTime) / 1000; |
| 22 | logText( |
| 23 | ` POS loading time: ${loadingTimeSec.toFixed(2)} seconds for 20000 products` |
| 24 | ); |
| 25 | }, |
| 26 | }, |
| 27 | ].flat(), |
| 28 | }); |