|
| 1 | +// Ensure that topbar popover menus content can be scrolled on mobile. |
| 2 | +go-to: "file://" + |DOC_PATH| + "/lib2/index.html" |
| 3 | +store-value: (window_height, 500) |
| 4 | +set-window-size: (400, |window_height|) |
| 5 | + |
| 6 | +include: "utils.goml" |
| 7 | + |
| 8 | +// We open the settings menu |
| 9 | +call-function: ("open-settings-menu", {}) |
| 10 | +// We ensure it's not scrolled down yet. |
| 11 | +assert-property: ("#settings", {"scrollTop": 0}) |
| 12 | +// We ensure its height is smaller than the window's, but its content's height is bigger. |
| 13 | +store-property: ("#settings", {"offsetHeight": menu_height, "scrollHeight": scroll_height}) |
| 14 | +assert: |menu_height| < |window_height| && |scroll_height| > |window_height| |
| 15 | + |
| 16 | +// We scroll to the last element of the menu. |
| 17 | +scroll-to: "#settings .setting-line:last-of-type input" |
| 18 | +// The item should be visible now, and so the Y scroll value should have changed. |
| 19 | +assert-property: ("#settings", {"scrollTop": 295}) |
| 20 | + |
| 21 | +// Now we open the help menu. |
| 22 | +click: ".help-menu a" |
| 23 | +wait-for: "#help" |
| 24 | +// We ensure it's not scrolled down yet. |
| 25 | +assert-property: ("#help", {"scrollTop": 0}) |
| 26 | +// We ensure its height is smaller than the window's, but its content's height is bigger. |
| 27 | +store-property: ("#help", {"offsetHeight": menu_height, "scrollHeight": scroll_height}) |
| 28 | +assert: |menu_height| < |window_height| && |scroll_height| > |window_height| |
| 29 | + |
| 30 | +// We scroll to the last element of the menu. |
| 31 | +scroll-to: "#help .infos > :last-child" |
| 32 | +// The item should be visible now, and so the Y scroll value should have changed. |
| 33 | +assert-property: ("#help", {"scrollTop": 339}) |
0 commit comments