Add GUI test for toggle filter and opacity
This commit is contained in:
parent
f76c4b84c9
commit
188f31eba0
@ -40,3 +40,32 @@ assert-attribute-false: (
|
||||
click: "#toggle-all-docs"
|
||||
wait-for-text: ("#toggle-all-docs", "[−]")
|
||||
assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
|
||||
|
||||
// Checking the toggles style.
|
||||
show-text: true
|
||||
define-function: (
|
||||
"check-color",
|
||||
(theme, filter),
|
||||
[
|
||||
// Setting the theme.
|
||||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
|
||||
// We reload the page so the local storage settings are being used.
|
||||
("reload"),
|
||||
|
||||
("assert-css", ("details.rustdoc-toggle > summary::before", {
|
||||
"opacity": "0.5",
|
||||
"filter": |filter|,
|
||||
}, ALL)),
|
||||
("move-cursor-to", "details.rustdoc-toggle summary"),
|
||||
("assert-css", ("details.rustdoc-toggle > summary:hover::before", {
|
||||
"opacity": "1",
|
||||
"filter": |filter|,
|
||||
})),
|
||||
// moving the cursor somewhere else to not mess with next function calls.
|
||||
("move-cursor-to", ".search-input"),
|
||||
]
|
||||
)
|
||||
|
||||
call-function: ("check-color", {"theme": "ayu", "filter": "invert(1)"})
|
||||
call-function: ("check-color", {"theme": "dark", "filter": "invert(1)"})
|
||||
call-function: ("check-color", {"theme": "light", "filter": "none"})
|
||||
|
Loading…
x
Reference in New Issue
Block a user