diff options
author | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-05 09:13:28 +0100 |
---|---|---|
committer | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-11 09:32:08 +0000 |
commit | cf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch) | |
tree | 40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/rustdoc-gui/scrape-examples-color.goml | |
parent | ca855e6e42787ecd062d81d53336fe6788ef51a9 (diff) | |
download | rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz |
Move /src/test to /tests
Diffstat (limited to 'tests/rustdoc-gui/scrape-examples-color.goml')
-rw-r--r-- | tests/rustdoc-gui/scrape-examples-color.goml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/scrape-examples-color.goml b/tests/rustdoc-gui/scrape-examples-color.goml new file mode 100644 index 00000000000..40f31b2771b --- /dev/null +++ b/tests/rustdoc-gui/scrape-examples-color.goml @@ -0,0 +1,60 @@ +// Check that scrape example code blocks have the expected colors. +goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" +show-text: true + +define-function: ( + "check-colors", + (theme, highlight, highlight_focus, help_border, help_color, help_hover_border, + help_hover_color), + block { + local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", } + reload: + wait-for: ".more-examples-toggle" + assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", { + "background-color": |highlight|, + }, ALL) + assert-css: (".scraped-example .example-wrap .rust span.highlight.focus", { + "background-color": |highlight_focus|, + }, ALL) + + assert-css: (".scraped-example-list .scrape-help", { + "border-color": |help_border|, + "color": |help_color|, + }) + move-cursor-to: ".scraped-example-list .scrape-help" + assert-css: (".scraped-example-list .scrape-help:hover", { + "border-color": |help_hover_border|, + "color": |help_hover_color|, + }) + // Moving the cursor to another item to not break next runs. + move-cursor-to: ".search-input" + } +) + +call-function: ("check-colors", { + "theme": "ayu", + "highlight": "rgb(91, 59, 1)", + "highlight_focus": "rgb(124, 75, 15)", + "help_border": "rgb(170, 170, 170)", + "help_color": "rgb(238, 238, 238)", + "help_hover_border": "rgb(255, 255, 255)", + "help_hover_color": "rgb(255, 255, 255)", +}) +call-function: ("check-colors", { + "theme": "dark", + "highlight": "rgb(91, 59, 1)", + "highlight_focus": "rgb(124, 75, 15)", + "help_border": "rgb(170, 170, 170)", + "help_color": "rgb(238, 238, 238)", + "help_hover_border": "rgb(255, 255, 255)", + "help_hover_color": "rgb(255, 255, 255)", +}) +call-function: ("check-colors", { + "theme": "light", + "highlight": "rgb(252, 255, 214)", + "highlight_focus": "rgb(246, 253, 176)", + "help_border": "rgb(85, 85, 85)", + "help_color": "rgb(51, 51, 51)", + "help_hover_border": "rgb(0, 0, 0)", + "help_hover_color": "rgb(0, 0, 0)", +}) |