summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/search-result-color.goml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/rustdoc-gui/search-result-color.goml (renamed from src/test/rustdoc-gui/search-result-color.goml)112
1 files changed, 53 insertions, 59 deletions
diff --git a/src/test/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index dde43b1c9..d6d54ec4b 100644
--- a/src/test/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -3,53 +3,32 @@
define-function: (
"check-result-color",
(result_kind, color, hover_color),
- [
- (
- "assert-css",
- (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL),
- ),
- (
- "assert-css",
- (
- ".result-" + |result_kind|,
- {"color": |entry_color|, "background-color": |background_color|},
- ),
- ),
- (
- "move-cursor-to",
+ block {
+ assert-css: (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL)
+ assert-css: (
".result-" + |result_kind|,
- ),
- (
- "assert-css",
- (
- ".result-" + |result_kind| + ":hover",
- {"color": |hover_entry_color|, "background-color": |hover_background_color|},
- ),
- ),
- (
- "assert-css",
- (".result-" + |result_kind| + ":hover ." + |result_kind|, {"color": |hover_color|}),
- ),
- (
- "move-cursor-to",
- ".search-input",
- ),
- (
- "focus",
- ".result-" + |result_kind|,
- ),
- (
- "assert-css",
- (
- ".result-" + |result_kind| + ":focus",
- {"color": |hover_entry_color|, "background-color": |hover_background_color|},
- ),
- ),
- (
- "assert-css",
- (".result-" + |result_kind| + ":focus ." + |result_kind|, {"color": |hover_color|}),
- ),
- ],
+ {"color": |entry_color|, "background-color": |background_color|},
+ )
+ move-cursor-to: ".result-" + |result_kind|
+ assert-css: (
+ ".result-" + |result_kind| + ":hover",
+ {"color": |hover_entry_color|, "background-color": |hover_background_color|},
+ )
+ assert-css: (
+ ".result-" + |result_kind| + ":hover ." + |result_kind|,
+ {"color": |hover_color|},
+ )
+ move-cursor-to: ".search-input"
+ focus: ".result-" + |result_kind|
+ assert-css: (
+ ".result-" + |result_kind| + ":focus",
+ {"color": |hover_entry_color|, "background-color": |hover_background_color|},
+ )
+ assert-css: (
+ ".result-" + |result_kind| + ":focus ." + |result_kind|,
+ {"color": |hover_color|},
+ )
+ },
)
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
@@ -65,7 +44,12 @@ local-storage: {
reload:
// Waiting for the search results to appear...
-wait-for: "#titles"
+wait-for: "#search-tabs"
+assert-css: (
+ "#search-tabs > button > .count",
+ {"color": "rgb(136, 136, 136)"},
+ ALL,
+)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(197, 197, 197)"},
@@ -177,7 +161,12 @@ local-storage: {
reload:
// Waiting for the search results to appear...
-wait-for: "#titles"
+wait-for: "#search-tabs"
+assert-css: (
+ "#search-tabs > button > .count",
+ {"color": "rgb(136, 136, 136)"},
+ ALL,
+)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(221, 221, 221)"},
@@ -274,7 +263,12 @@ local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:
// Waiting for the search results to appear...
-wait-for: "#titles"
+wait-for: "#search-tabs"
+assert-css: (
+ "#search-tabs > button > .count",
+ {"color": "rgb(136, 136, 136)"},
+ ALL,
+)
assert-css: (
"//*[@class='desc'][text()='Just a normal struct.']",
{"color": "rgb(0, 0, 0)"},
@@ -374,20 +368,20 @@ show-text: true
define-function: (
"check-alias",
(theme, alias, grey),
- [
- ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
- ("reload"),
- ("write", (".search-input", "thisisanalias")),
+ block {
+ local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ reload:
+ write: (".search-input", "thisisanalias")
// To be SURE that the search will be run.
- ("press-key", 'Enter'),
+ press-key: 'Enter'
// Waiting for the search results to appear...
- ("wait-for", "#titles"),
+ wait-for: "#search-tabs"
// Checking that the colors for the alias element are the ones expected.
- ("assert-css", (".result-name > .alias", {"color": |alias|})),
- ("assert-css", (".result-name > .alias > .grey", {"color": |grey|})),
+ assert-css: (".result-name > .alias", {"color": |alias|})
+ assert-css: (".result-name > .alias > .grey", {"color": |grey|})
// Leave the search results to prevent reloading with an already filled search input.
- ("press-key", "Escape"),
- ],
+ press-key: "Escape"
+ },
)
call-function: ("check-alias", {