diff --git a/tests/rustdoc-gui/mobile-topbar-menu-popovers.goml b/tests/rustdoc-gui/mobile-topbar-menu-popovers.goml new file mode 100644 index 000000000000..1f4adc70101f --- /dev/null +++ b/tests/rustdoc-gui/mobile-topbar-menu-popovers.goml @@ -0,0 +1,33 @@ +// 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. +assert-property: ("#settings .settings", {"scrollTop": 295}) + +// 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})