mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add rustdoc GUI regression test for #151209
This commit is contained in:
@@ -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})
|
||||
Reference in New Issue
Block a user