]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/help-page.goml
Rollup merge of #105715 - estebank:unsatisfied-bounds-label, r=compiler-errors
[rust.git] / src / test / rustdoc-gui / help-page.goml
1 // This test ensures that opening the help page in its own tab works.
2 goto: "file://" + |DOC_PATH| + "/help.html"
3 size: (1000, 1000) // Try desktop size first.
4 wait-for: "#help"
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 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"))
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         }, ALL)),
31     ],
32 )
33
34 call-function: ("check-colors", {
35     "theme": "ayu",
36     "color": "rgb(197, 197, 197)",
37     "background": "rgb(49, 69, 89)",
38     "box_shadow": "rgb(92, 103, 115)",
39 })
40 call-function: ("check-colors", {
41     "theme": "dark",
42     "color": "rgb(221, 221, 221)",
43     "background": "rgb(250, 251, 252)",
44     "box_shadow": "rgb(198, 203, 209)",
45 })
46 call-function: ("check-colors", {
47     "theme": "light",
48     "color": "rgb(0, 0, 0)",
49     "background": "rgb(250, 251, 252)",
50     "box_shadow": "rgb(198, 203, 209)",
51 })
52
53 // This test ensures that opening the help popover without switching pages works.
54 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
55 size: (1000, 1000) // Only supported on desktop.
56 assert-false: "#help"
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"))