Add rustdoc GUI regression test for #151209
This commit is contained in:
parent
c14d78f4ae
commit
76ea822db2
1 changed files with 33 additions and 0 deletions
33
tests/rustdoc-gui/mobile-topbar-menu-popovers.goml
Normal file
33
tests/rustdoc-gui/mobile-topbar-menu-popovers.goml
Normal file
|
|
@ -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})
|
||||
Loading…
Add table
Add a link
Reference in a new issue