11// Check that scrape example code blocks have the expected colors.
22goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
3+ show-text: true
34
45define-function: (
56 "check-colors",
6- (theme, highlight, highlight_focus),
7+ (theme, highlight, highlight_focus, help_border, help_color, help_hover_border,
8+ help_hover_color),
79 [
810 ("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }),
911 ("reload"),
@@ -14,21 +16,45 @@ define-function: (
1416 ("assert-css", (".scraped-example .example-wrap .rust span.highlight.focus", {
1517 "background-color": |highlight_focus|,
1618 }, ALL)),
19+
20+ ("assert-css", (".scraped-example-list .scrape-help", {
21+ "border-color": |help_border|,
22+ "color": |help_color|,
23+ })),
24+ ("move-cursor-to", ".scraped-example-list .scrape-help"),
25+ ("assert-css", (".scraped-example-list .scrape-help:hover", {
26+ "border-color": |help_hover_border|,
27+ "color": |help_hover_color|,
28+ })),
29+ // Moving the cursor to another item to not break next runs.
30+ ("move-cursor-to", ".search-input"),
1731 ]
1832)
1933
2034call-function: ("check-colors", {
2135 "theme": "ayu",
2236 "highlight": "rgb(91, 59, 1)",
2337 "highlight_focus": "rgb(124, 75, 15)",
38+ "help_border": "rgb(170, 170, 170)",
39+ "help_color": "rgb(238, 238, 238)",
40+ "help_hover_border": "rgb(255, 255, 255)",
41+ "help_hover_color": "rgb(255, 255, 255)",
2442})
2543call-function: ("check-colors", {
2644 "theme": "dark",
2745 "highlight": "rgb(91, 59, 1)",
2846 "highlight_focus": "rgb(124, 75, 15)",
47+ "help_border": "rgb(170, 170, 170)",
48+ "help_color": "rgb(238, 238, 238)",
49+ "help_hover_border": "rgb(255, 255, 255)",
50+ "help_hover_color": "rgb(255, 255, 255)",
2951})
3052call-function: ("check-colors", {
3153 "theme": "light",
3254 "highlight": "rgb(252, 255, 214)",
3355 "highlight_focus": "rgb(246, 253, 176)",
56+ "help_border": "rgb(85, 85, 85)",
57+ "help_color": "rgb(51, 51, 51)",
58+ "help_hover_border": "rgb(0, 0, 0)",
59+ "help_hover_color": "rgb(0, 0, 0)",
3460})
0 commit comments