2022-12-26 12:09:40 +00:00
|
|
|
// Checking the colors of the search tab headers.
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html?search=something"
|
2022-12-26 12:09:40 +00:00
|
|
|
show-text: true
|
|
|
|
|
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
|
|
|
(theme, background, background_selected, background_hover, border_bottom,
|
|
|
|
border_bottom_selected, border_bottom_hover, border_top, border_top_selected,
|
|
|
|
border_top_hover),
|
2023-01-06 14:18:51 +00:00
|
|
|
block {
|
2022-12-26 12:09:40 +00:00
|
|
|
// Setting the theme.
|
2023-04-11 17:11:34 +00:00
|
|
|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
2023-01-06 14:18:51 +00:00
|
|
|
reload:
|
2022-12-26 12:09:40 +00:00
|
|
|
|
|
|
|
// These two commands are used to be sure the search will be run.
|
2023-01-06 14:18:51 +00:00
|
|
|
focus: ".search-input"
|
|
|
|
press-key: "Enter"
|
2022-12-26 12:09:40 +00:00
|
|
|
|
2023-01-06 14:18:51 +00:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-css: ("#search-tabs > button:not(.selected)", {
|
2022-12-26 12:09:40 +00:00
|
|
|
"background-color": |background|,
|
|
|
|
"border-bottom": |border_bottom|,
|
|
|
|
"border-top": |border_top|,
|
2023-01-06 14:18:51 +00:00
|
|
|
})
|
|
|
|
assert-css: ("#search-tabs > button.selected", {
|
2022-12-26 12:09:40 +00:00
|
|
|
"background-color": |background_selected|,
|
|
|
|
"border-bottom": |border_bottom_selected|,
|
|
|
|
"border-top": |border_top_selected|,
|
2023-01-06 14:18:51 +00:00
|
|
|
})
|
|
|
|
move-cursor-to: "#search-tabs > button:not(.selected)"
|
|
|
|
assert-css: ("#search-tabs > button:not(.selected):hover", {
|
2022-12-26 12:09:40 +00:00
|
|
|
"background-color": |background_hover|,
|
|
|
|
"border-bottom": |border_bottom_hover|,
|
|
|
|
"border-top": |border_top_hover|,
|
2023-01-06 14:18:51 +00:00
|
|
|
})
|
2022-12-26 12:09:40 +00:00
|
|
|
// To prevent disrupting next run of this function.
|
2023-01-06 14:18:51 +00:00
|
|
|
move-cursor-to: ".search-input"
|
|
|
|
},
|
2022-12-26 12:09:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "ayu",
|
|
|
|
"background": "rgba(0, 0, 0, 0)",
|
|
|
|
"background_selected": "rgb(20, 25, 32)",
|
|
|
|
"background_hover": "rgba(0, 0, 0, 0)",
|
|
|
|
"border_bottom": "0px none rgb(197, 197, 197)",
|
|
|
|
"border_bottom_selected": "1px solid rgb(255, 180, 76)",
|
|
|
|
"border_bottom_hover": "1px solid rgba(242, 151, 24, 0.3)",
|
|
|
|
"border_top": "0px none rgb(197, 197, 197)",
|
|
|
|
"border_top_selected": "0px none rgb(197, 197, 197)",
|
|
|
|
"border_top_hover": "0px none rgb(197, 197, 197)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "dark",
|
|
|
|
"background": "rgb(37, 37, 37)",
|
|
|
|
"background_selected": "rgb(53, 53, 53)",
|
|
|
|
"background_hover": "rgb(53, 53, 53)",
|
|
|
|
"border_bottom": "0px none rgb(221, 221, 221)",
|
|
|
|
"border_bottom_selected": "0px none rgb(221, 221, 221)",
|
|
|
|
"border_bottom_hover": "0px none rgb(221, 221, 221)",
|
|
|
|
"border_top": "2px solid rgb(37, 37, 37)",
|
|
|
|
"border_top_selected": "2px solid rgb(0, 137, 255)",
|
|
|
|
"border_top_hover": "2px solid rgb(0, 137, 255)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "light",
|
|
|
|
"background": "rgb(230, 230, 230)",
|
|
|
|
"background_selected": "rgb(255, 255, 255)",
|
|
|
|
"background_hover": "rgb(255, 255, 255)",
|
|
|
|
"border_bottom": "0px none rgb(0, 0, 0)",
|
|
|
|
"border_bottom_selected": "0px none rgb(0, 0, 0)",
|
|
|
|
"border_bottom_hover": "0px none rgb(0, 0, 0)",
|
|
|
|
"border_top": "2px solid rgb(230, 230, 230)",
|
|
|
|
"border_top_selected": "2px solid rgb(0, 137, 255)",
|
|
|
|
"border_top_hover": "2px solid rgb(0, 137, 255)",
|
|
|
|
})
|