Switch rustdoc-gui test to function call

This commit is contained in:
Guillaume Gomez 2022-11-26 22:35:05 +01:00
parent 80a96467ec
commit b19e034745

View file

@ -48,23 +48,35 @@ compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topb
// Now checking the background color of the sidebar.
show-text: true
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)", "color": "rgb(221, 221, 221)"})
define-function: (
"check-colors",
(theme, color, background),
[
("local-storage", {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}),
("reload"),
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
reload:
// Open the sidebar menu.
("click", ".sidebar-menu-toggle"),
("assert-css", (".sidebar", {
"background-color": |background|,
"color": |color|,
})),
],
)
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)", "color": "rgb(197, 197, 197)"})
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)", "color": "rgb(0, 0, 0)"})
call-function: ("check-colors", {
"theme": "ayu",
"color": "rgb(197, 197, 197)",
"background": "rgb(20, 25, 31)",
})
call-function: ("check-colors", {
"theme": "dark",
"color": "rgb(221, 221, 221)",
"background": "rgb(80, 80, 80)",
})
call-function: ("check-colors", {
"theme": "light",
"color": "rgb(0, 0, 0)",
"background": "rgb(245, 245, 245)",
})