1 // This test ensures that opening the help page in its own tab works.
2 go-to: "file://" + |DOC_PATH| + "/help.html"
3 set-window-size: (1000, 1000) // Try desktop size first.
5 assert-css: ("#help", {"display": "block"})
6 assert-css: ("#help dd", {"font-size": "16px"})
7 click: "#help-button > a"
8 assert-css: ("#help", {"display": "block"})
9 compare-elements-property: (".sub", "#help", ["offsetWidth"])
10 compare-elements-position: (".sub", "#help", ("x"))
11 set-window-size: (500, 1000) // Try mobile next.
12 assert-css: ("#help", {"display": "block"})
13 compare-elements-property: (".sub", "#help", ["offsetWidth"])
14 compare-elements-position: (".sub", "#help", ("x"))
16 // Checking the color of the elements of the help menu.
20 (theme, color, background, box_shadow),
23 set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
24 // We reload the page so the local storage settings are being used.
26 assert-css: ("#help kbd", {
28 "background-color": |background|,
29 "box-shadow": |box_shadow| + " 0px -1px 0px 0px inset",
34 call-function: ("check-colors", {
36 "color": "rgb(197, 197, 197)",
37 "background": "rgb(49, 69, 89)",
38 "box_shadow": "rgb(92, 103, 115)",
40 call-function: ("check-colors", {
42 "color": "rgb(0, 0, 0)",
43 "background": "rgb(250, 251, 252)",
44 "box_shadow": "rgb(198, 203, 209)",
46 call-function: ("check-colors", {
48 "color": "rgb(0, 0, 0)",
49 "background": "rgb(250, 251, 252)",
50 "box_shadow": "rgb(198, 203, 209)",
53 // This test ensures that opening the help popover without switching pages works.
54 go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
55 set-window-size: (1000, 1000) // Only supported on desktop.
57 click: "#help-button > a"
58 assert-css: ("#help", {"display": "block"})
59 assert-css: ("#help dd", {"font-size": "16px"})
60 click: "#help-button > a"
61 assert-css: ("#help", {"display": "none"})
62 compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
63 compare-elements-position-false: (".sub", "#help", ("x"))
65 // This test ensures that the "the rustdoc book" anchor link within the help popover works.
66 go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
67 set-window-size: (1000, 1000) // Popover only appears when the screen width is >700px.
69 click: "#help-button > a"
70 click: ".popover a[href='https://doc.rust-lang.org/rustdoc/']"
71 wait-for-document-property: {"URL": "https://doc.rust-lang.org/rustdoc/"}