about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-12-29 12:10:39 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-12-29 12:10:39 +0100
commit4b5c0923c779e14f68ce6a104ab4e6c029f0627f (patch)
tree8d984f68acb660858a3888654aaff340056a7e31 /src/test
parent5494da23afe9a8ff178475c6bd9d3efb5ddac645 (diff)
downloadrust-4b5c0923c779e14f68ce6a104ab4e6c029f0627f.tar.gz
rust-4b5c0923c779e14f68ce6a104ab4e6c029f0627f.zip
Extend rustdoc GUI test for scraped examples
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/scrape-examples-color.goml28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/test/rustdoc-gui/scrape-examples-color.goml b/src/test/rustdoc-gui/scrape-examples-color.goml
index 5175891e7ba..360e2af8ba4 100644
--- a/src/test/rustdoc-gui/scrape-examples-color.goml
+++ b/src/test/rustdoc-gui/scrape-examples-color.goml
@@ -1,9 +1,11 @@
 // 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),
+    (theme, highlight, highlight_focus, help_border, help_color, help_hover_border,
+     help_hover_color),
     [
         ("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }),
         ("reload"),
@@ -14,6 +16,18 @@ define-function: (
         ("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"),
     ]
 )
 
@@ -21,14 +35,26 @@ 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)",
 })