rust/tests/rustdoc-gui/search-tab.goml
2023-08-13 11:40:23 +02:00

77 lines
2.7 KiB
Plaintext

// Checking the colors of the search tab headers.
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html?search=something"
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),
block {
// Setting the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
// These two commands are used to be sure the search will be run.
focus: ".search-input"
press-key: "Enter"
wait-for: "#search-tabs"
assert-css: ("#search-tabs > button:not(.selected)", {
"background-color": |background|,
"border-bottom": |border_bottom|,
"border-top": |border_top|,
})
assert-css: ("#search-tabs > button.selected", {
"background-color": |background_selected|,
"border-bottom": |border_bottom_selected|,
"border-top": |border_top_selected|,
})
move-cursor-to: "#search-tabs > button:not(.selected)"
assert-css: ("#search-tabs > button:not(.selected):hover", {
"background-color": |background_hover|,
"border-bottom": |border_bottom_hover|,
"border-top": |border_top_hover|,
})
// To prevent disrupting next run of this function.
move-cursor-to: ".search-input"
},
)
call-function: ("check-colors", {
"theme": "ayu",
"background": "transparent",
"background_selected": "#141920",
"background_hover": "transparent",
"border_bottom": "0px none #c5c5c5",
"border_bottom_selected": "1px solid #ffb44c",
"border_bottom_hover": "1px solid rgba(242, 151, 24, 0.3)",
"border_top": "0px none #c5c5c5",
"border_top_selected": "0px none #c5c5c5",
"border_top_hover": "0px none #c5c5c5",
})
call-function: ("check-colors", {
"theme": "dark",
"background": "#252525",
"background_selected": "#353535",
"background_hover": "#353535",
"border_bottom": "0px none #ddd",
"border_bottom_selected": "0px none #ddd",
"border_bottom_hover": "0px none #ddd",
"border_top": "2px solid #252525",
"border_top_selected": "2px solid #0089ff",
"border_top_hover": "2px solid #0089ff",
})
call-function: ("check-colors", {
"theme": "light",
"background": "#e6e6e6",
"background_selected": "#fff",
"background_hover": "#fff",
"border_bottom": "0px none #000",
"border_bottom_selected": "0px none #000",
"border_bottom_hover": "0px none #000",
"border_top": "2px solid #e6e6e6",
"border_top_selected": "2px solid #0089ff",
"border_top_hover": "2px solid #0089ff",
})