@@ -13,6 +13,44 @@ assert-css: ("#help", {"display": "block"})
13
13
compare-elements-property: (".sub", "#help", ["offsetWidth"])
14
14
compare-elements-position: (".sub", "#help", ("x"))
15
15
16
+ // Checking the color of the elements of the help menu.
17
+ show-text: true
18
+ define-function: (
19
+ "check-colors",
20
+ (theme, color, background, box_shadow),
21
+ [
22
+ // Setting the theme.
23
+ ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
24
+ // We reload the page so the local storage settings are being used.
25
+ ("reload"),
26
+ ("assert-css", ("#help kbd", {
27
+ "color": |color|,
28
+ "background-color": |background|,
29
+ "box-shadow": |box_shadow| + " 0px -1px 0px 0px inset",
30
+ "cursor": "default",
31
+ }, ALL)),
32
+ ],
33
+ )
34
+
35
+ call-function: ("check-colors", {
36
+ "theme": "ayu",
37
+ "color": "rgb(197, 197, 197)",
38
+ "background": "rgb(49, 69, 89)",
39
+ "box_shadow": "rgb(92, 103, 115)",
40
+ })
41
+ call-function: ("check-colors", {
42
+ "theme": "dark",
43
+ "color": "rgb(221, 221, 221)",
44
+ "background": "rgb(250, 251, 252)",
45
+ "box_shadow": "rgb(198, 203, 209)",
46
+ })
47
+ call-function: ("check-colors", {
48
+ "theme": "light",
49
+ "color": "rgb(0, 0, 0)",
50
+ "background": "rgb(250, 251, 252)",
51
+ "box_shadow": "rgb(198, 203, 209)",
52
+ })
53
+
16
54
// This test ensures that opening the help popover without switching pages works.
17
55
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
18
56
size: (1000, 1000) // Only supported on desktop.
0 commit comments