summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-gui/sidebar-mobile.goml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile.goml18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
index 033c65783..453873f1b 100644
--- a/src/test/rustdoc-gui/sidebar-mobile.goml
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -1,7 +1,7 @@
// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
// This is especially important for devices for "text-first" content (like for users with
// sight issues).
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// Switching to "mobile view" by reducing the width to 600px.
size: (600, 600)
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
@@ -13,7 +13,7 @@ click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
// Force the sidebar open by focusing a link inside it.
// This makes it easier for keyboard users to get to it.
-focus: ".sidebar-title a"
+focus: ".sidebar-elems h3 a"
assert-css: (".sidebar", {"display": "block", "left": "0px"})
// When we tab out of the sidebar, close it.
focus: ".search-input"
@@ -23,6 +23,11 @@ assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"left": "0px"})
+// Make sure the "struct Foo" header is hidden, since the mobile topbar already does it.
+assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='Foo']/parent::h2", {"display": "none"})
+// Make sure the global navigation is still here.
+assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='In test_docs']/parent::h2", {"display": "block"})
+
// Click elsewhere.
click: "body"
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
@@ -39,26 +44,27 @@ assert-position: ("#method\.must_use", {"y": 45})
// Check that the bottom-most item on the sidebar menu can be scrolled fully into view.
click: ".sidebar-menu-toggle"
scroll-to: ".block.keyword li:nth-child(1)"
-compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 543})
+compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 543.19})
// Now checking the background color of the sidebar.
+show-text: true
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)"})
+assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)", "color": "rgb(221, 221, 221)"})
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)"})
+assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)", "color": "rgb(197, 197, 197)"})
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)"})
+assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)", "color": "rgb(0, 0, 0)"})