Clean up utils.goml file

This commit is contained in:
Guillaume Gomez
2025-12-26 17:20:55 +01:00
parent d3f16d2f35
commit 3d92872170
2 changed files with 24 additions and 25 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ define-function: (
"check-colors",
[theme, color, background],
block {
call-function: ("switch-theme-mobile", {"theme": |theme|})
call-function: ("switch-theme", {"theme": |theme|})
reload:
// Open the sidebar menu.
+23 -24
View File
@@ -1,35 +1,34 @@
// This file contains code to be re-used by other tests.
define-function: (
"open-settings-menu",
[],
block {
// Open the settings menu.
click: "rustdoc-toolbar .settings-menu"
// Wait for the popover to appear...
wait-for-css: ("#settings", {"display": "block"})
}
)
define-function: (
"close-settings-menu",
[],
block {
click: "rustdoc-toolbar .settings-menu"
wait-for-css-false: ("#settings", {"display": "block"})
}
)
define-function: (
"switch-theme",
[theme],
block {
// Set the theme.
// Open the settings menu.
click: "rustdoc-toolbar .settings-menu"
// Wait for the popover to appear...
wait-for: "#settings"
call-function: ("open-settings-menu", {})
// Change the setting.
click: "#theme-"+ |theme|
// Close the popover.
click: "rustdoc-toolbar .settings-menu"
// Ensure that the local storage was correctly updated.
assert-local-storage: {"rustdoc-theme": |theme|}
},
)
define-function: (
"switch-theme-mobile",
[theme],
block {
// Set the theme.
// Open the settings menu.
click: "rustdoc-topbar .settings-menu"
// Wait for the popover to appear...
wait-for: "#settings"
// Change the setting.
click: "#theme-"+ |theme|
// Close the popover.
click: "rustdoc-topbar .settings-menu"
call-function: ("close-settings-menu", {})
// Ensure that the local storage was correctly updated.
assert-local-storage: {"rustdoc-theme": |theme|}
},