| // Ensure that topbar popover menus content can be scrolled on mobile. |
| go-to: "file://" + |DOC_PATH| + "/lib2/index.html" |
| store-value: (window_height, 500) |
| set-window-size: (400, |window_height|) |
| |
| include: "utils.goml" |
| |
| // We open the settings menu |
| call-function: ("open-settings-menu", {}) |
| // We ensure it's not scrolled down yet. |
| assert-property: ("#settings .settings", {"scrollTop": 0}) |
| // We ensure its height is smaller than the window's, but its content's height is bigger. |
| store-property: ("#settings .settings", {"offsetHeight": menu_height, "scrollHeight": scroll_height}) |
| assert: |menu_height| < |window_height| && |scroll_height| > |window_height| |
| |
| // We scroll to the last element of the menu. |
| scroll-to: "#settings .setting-line:last-of-type input" |
| // The item should be visible now, and so the Y scroll value should have changed. |
| // Note: The `scrollTop` value will change if settings are added or removed. |
| assert-property: ("#settings .settings", {"scrollTop": 335}) |
| |
| // Now we open the help menu. |
| click: ".help-menu a" |
| wait-for: "#help" |
| // We ensure it's not scrolled down yet. |
| assert-property: ("#help .content", {"scrollTop": 0}) |
| // We ensure its height is smaller than the window's, but its content's height is bigger. |
| store-property: ("#help .content", {"offsetHeight": menu_height, "scrollHeight": scroll_height}) |
| assert: |menu_height| < |window_height| && |scroll_height| > |window_height| |
| |
| // We scroll to the last element of the menu. |
| scroll-to: "#help .infos > :last-child" |
| // The item should be visible now, and so the Y scroll value should have changed. |
| assert-property: ("#help .content", {"scrollTop": 339}) |