1 // Check that scrape example code blocks have the expected colors.
2 goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
7 (theme, highlight, highlight_focus, help_border, help_color, help_hover_border,
10 local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
12 wait-for: ".more-examples-toggle"
13 assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", {
14 "background-color": |highlight|,
16 assert-css: (".scraped-example .example-wrap .rust span.highlight.focus", {
17 "background-color": |highlight_focus|,
20 assert-css: (".scraped-example-list .scrape-help", {
21 "border-color": |help_border|,
22 "color": |help_color|,
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|,
29 // Moving the cursor to another item to not break next runs.
30 move-cursor-to: ".search-input"
34 call-function: ("check-colors", {
36 "highlight": "rgb(91, 59, 1)",
37 "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)",
43 call-function: ("check-colors", {
45 "highlight": "rgb(91, 59, 1)",
46 "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)",
52 call-function: ("check-colors", {
54 "highlight": "rgb(252, 255, 214)",
55 "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)",
62 // Now testing the top and bottom background in case there is only one scraped examples.
63 goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
67 (theme, background_color_start, background_color_end),
69 local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
71 assert-css: (".scraped-example:not(.expanded) .code-wrapper::before", {
72 "background-image": "linear-gradient(" + |background_color_start| + ", " +
73 |background_color_end| + ")",
75 assert-css: (".scraped-example:not(.expanded) .code-wrapper::after", {
76 "background-image": "linear-gradient(to top, " + |background_color_start| + ", " +
77 |background_color_end| + ")",
82 call-function: ("check-background", {
84 "background_color_start": "rgb(15, 20, 25)",
85 "background_color_end": "rgba(15, 20, 25, 0)",
87 call-function: ("check-background", {
89 "background_color_start": "rgb(53, 53, 53)",
90 "background_color_end": "rgba(53, 53, 53, 0)",
92 call-function: ("check-background", {
94 "background_color_start": "rgb(255, 255, 255)",
95 "background_color_end": "rgba(255, 255, 255, 0)",