summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/settings.goml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-gui/settings.goml')
-rw-r--r--tests/rustdoc-gui/settings.goml87
1 files changed, 75 insertions, 12 deletions
diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml
index a84172885..733be9beb 100644
--- a/tests/rustdoc-gui/settings.goml
+++ b/tests/rustdoc-gui/settings.goml
@@ -1,6 +1,6 @@
// This test ensures that the settings menu display is working as expected and that
// the settings page is also rendered as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true // needed when we check for colors below.
// First, we check that the settings page doesn't exist.
assert-false: "#settings"
@@ -35,7 +35,7 @@ wait-for: "#alternative-display #search"
assert: "#main-content.hidden"
// Now let's check the content of the settings menu.
-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
+set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
click: "#settings-menu"
wait-for: "#settings"
@@ -56,11 +56,12 @@ move-cursor-to: "#settings-menu > a"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-width": "2px",
},
)
-assert-css: ("#theme-light", {"border-color": "rgb(221, 221, 221)", "box-shadow": "none"})
+assert-css: ("#theme-light", {"border-color": "rgb(153, 153, 153)", "box-shadow": "none"})
// Let's start with the hover for radio buttons.
move-cursor-to: "#theme-dark"
assert-css: (
@@ -68,26 +69,36 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-width": "2px",
},
)
move-cursor-to: "#theme-light"
-assert-css: ("#theme-light", {"border-color": "rgb(33, 150, 243)", "box-shadow": "none"})
+assert-css: (
+ "#theme-light",
+ {
+ "border-color": "rgb(33, 150, 243)",
+ "box-shadow": "none",
+ "border-width": "2px",
+ }
+)
move-cursor-to: "#theme-ayu"
// Let's now check with the focus for radio buttons.
focus: "#theme-dark"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
+ "border-width": "2px",
},
)
focus: "#theme-light"
assert-css: (
"#theme-light",
{
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-width": "2px",
},
)
// Now we check we both focus and hover for radio buttons.
@@ -98,6 +109,7 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
+ "border-width": "2px",
},
)
move-cursor-to: "#theme-light"
@@ -107,6 +119,7 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-width": "2px",
},
)
// Now we check the setting-radio-name is on a different line than the label.
@@ -142,7 +155,18 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(153, 153, 153)",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
// Let's start with the hover for toggles.
@@ -152,6 +176,18 @@ assert-css: (
{
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+move-cursor-to: "#auto-hide-method-docs"
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(33, 150, 243)",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
move-cursor-to: "#settings-menu > a"
@@ -161,8 +197,21 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+focus: "#auto-hide-method-docs"
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
// Now we check we both focus and hover for toggles.
@@ -174,6 +223,20 @@ assert-css: (
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+move-cursor-to: "#auto-hide-method-docs"
+focus: "#auto-hide-method-docs"
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(33, 150, 243)",
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
@@ -189,7 +252,7 @@ assert-text: ("#preferred-light-theme .setting-radio-name", "Preferred light the
// We now check that clicking on the toggles' text is like clicking on the checkbox.
// To test it, we use the "Disable keyboard shortcuts".
-local-storage: {"rustdoc-disable-shortcuts": "false"}
+set-local-storage: {"rustdoc-disable-shortcuts": "false"}
click: ".setting-line:last-child .setting-check span"
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
@@ -227,7 +290,7 @@ wait-for-css: ("#settings-menu .popover", {"display": "none"})
wait-for-css: ("#help-button .popover", {"display": "block"})
// Now we go to the settings page to check that the CSS is loaded as expected.
-goto: "file://" + |DOC_PATH| + "/settings.html"
+go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})
@@ -247,7 +310,7 @@ javascript: true
// Check for the display on small screen
show-text: true
reload:
-size: (300, 1000)
+set-window-size: (300, 1000)
click: "#settings-menu"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})