Skip to content

Commit 605e098

Browse files
committed
Auto merge of #151145 - GuillaumeGomez:reduce-rustdoc-flakyness, r=jieyouxu
Reduce rustdoc GUI flakyness, take 2 Fixes #151006 (hopefully). Seems like #151053 did not fix the flakyness issue, so here is another take on this issue. r? @jieyouxu
2 parents b6fdaf2 + 4bacdf7 commit 605e098

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

tests/rustdoc-gui/utils.goml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,37 @@ define-function: (
2929
"open-settings-menu",
3030
[],
3131
block {
32-
call-function: ("click-settings-button", {})
33-
// Wait for the popover to appear...
34-
wait-for-css: ("#settings", {"display": "block"})
32+
store-count: ("#settings", nb_settings_menu)
33+
if: (|nb_settings_menu| != 0, block {
34+
store-css: ("#settings", {"display": settings_display})
35+
})
36+
else: block {
37+
store-value: (settings_display, "none")
38+
}
39+
if: (|settings_display| != "block", block {
40+
call-function: ("click-settings-button", {})
41+
// Wait for the popover to appear...
42+
wait-for-css: ("#settings", {"display": "block"})
43+
})
3544
}
3645
)
3746

3847
define-function: (
3948
"close-settings-menu",
4049
[],
4150
block {
42-
call-function: ("click-settings-button", {})
43-
// Wait for the popover to disappear...
44-
wait-for-css-false: ("#settings", {"display": "block"})
51+
store-count: ("#settings", nb_settings_menu)
52+
if: (|nb_settings_menu| != 0, block {
53+
store-css: ("#settings", {"display": settings_display})
54+
})
55+
else: block {
56+
store-value: (settings_display, "block")
57+
}
58+
if: (|settings_display| == "block", block {
59+
call-function: ("click-settings-button", {})
60+
// Wait for the popover to disappear...
61+
wait-for-css-false: ("#settings", {"display": "block"})
62+
})
4563
}
4664
)
4765

0 commit comments

Comments
 (0)