Skip to content

Commit fca1007

Browse files
Add GUI test for click on setting text
1 parent 1ebf0d9 commit fca1007

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/rustdoc-gui/settings.goml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ wait-for: "#settings"
3434

3535
// We check that the "Use system theme" is disabled.
3636
assert-property: ("#use-system-theme", {"checked": "false"})
37-
assert: "//*[@class='setting-line']/*[text()='Use system theme']"
37+
assert: "//*[@class='setting-line']//span[text()='Use system theme']"
3838
// Meaning that only the "theme" menu is showing up.
3939
assert: ".setting-line:not(.hidden) #theme"
4040
assert: ".setting-line.hidden #preferred-dark-theme"
@@ -55,7 +55,13 @@ assert: ".setting-line.hidden #theme"
5555
assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme")
5656
assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
5757

58+
// We now check that clicking on the "sliders"' text is like clicking on the slider.
59+
// To test it, we use the "Disable keyboard shortcuts".
60+
local-storage: {"rustdoc-disable-shortcuts": "false"}
61+
click: ".setting-line:last-child .toggle .label"
62+
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
63+
5864
// Now we go to the settings page to check that the CSS is loaded as expected.
5965
goto: file://|DOC_PATH|/settings.html
6066
wait-for: "#settings"
61-
assert-css: (".setting-line .toggle", {"width": "45px", "margin-right": "20px"})
67+
assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"})

0 commit comments

Comments
 (0)