Skip to content

Commit b227e14

Browse files
Add rustdoc GUI regression test for #151209
1 parent b85f2d1 commit b227e14

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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

Comments
 (0)