2022-01-21 20:41:47 +01:00
|
|
|
// Ensures that the theme change is working as expected.
|
2021-05-02 16:50:14 +02:00
|
|
|
goto: file://|DOC_PATH|/test_docs/index.html
|
2022-05-11 23:11:31 +02:00
|
|
|
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.
|
2022-03-21 15:50:05 +01:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
2022-05-11 23:11:31 +02:00
|
|
|
assert-local-storage: { "rustdoc-theme": "ayu" }
|
|
|
|
|
click: "#theme-light"
|
|
|
|
|
// should be the light theme so let's check the color.
|
2022-03-21 15:50:05 +01:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
2022-05-11 23:11:31 +02:00
|
|
|
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" }
|
2022-01-29 10:44:27 +01:00
|
|
|
|
|
|
|
|
goto: file://|DOC_PATH|/settings.html
|
2022-01-19 23:06:17 +01:00
|
|
|
wait-for: "#settings"
|
2022-01-29 10:44:27 +01:00
|
|
|
click: "#theme-light"
|
2022-03-21 15:50:05 +01:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
2022-01-29 10:44:27 +01:00
|
|
|
assert-local-storage: { "rustdoc-theme": "light" }
|
|
|
|
|
|
|
|
|
|
click: "#theme-dark"
|
2022-03-21 15:50:05 +01:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
|
2022-01-29 10:44:27 +01:00
|
|
|
assert-local-storage: { "rustdoc-theme": "dark" }
|
|
|
|
|
|
|
|
|
|
click: "#theme-ayu"
|
2022-03-21 15:50:05 +01:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(15, 20, 25)" })
|
2022-01-29 10:44:27 +01:00
|
|
|
assert-local-storage: { "rustdoc-theme": "ayu" }
|