summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-gui/theme-change.goml
blob: b1de3c366149aaed91f57562c0e21920c1a9a217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Ensures that the theme change is working as expected.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
click: "#settings-menu"
wait-for: "#theme-ayu"
click: "#theme-ayu"
// should be the ayu theme so let's check the color.
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
assert-local-storage: { "rustdoc-theme": "ayu" }
click: "#theme-light"
// should be the light theme so let's check the color.
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
assert-local-storage: { "rustdoc-theme": "light" }
click: "#theme-dark"
// Should be the dark theme so let's check the color.
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
assert-local-storage: { "rustdoc-theme": "dark" }

goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
click: "#theme-light"
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
assert-local-storage: { "rustdoc-theme": "light" }

click: "#theme-dark"
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
assert-local-storage: { "rustdoc-theme": "dark" }

click: "#theme-ayu"
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
assert-local-storage: { "rustdoc-theme": "ayu" }