about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-05-23 16:53:44 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-05-24 15:40:50 +0200
commitfca1007ed31af41dfcc8e8c13a2c0676cfb28ace (patch)
tree161d66dece0d7a238b148e6d81992a350f88c615
parent1ebf0d9c72de95bd1de677f2e7234cea626e3fb7 (diff)
downloadrust-fca1007ed31af41dfcc8e8c13a2c0676cfb28ace.tar.gz
rust-fca1007ed31af41dfcc8e8c13a2c0676cfb28ace.zip
Add GUI test for click on setting text
-rw-r--r--src/test/rustdoc-gui/settings.goml10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/rustdoc-gui/settings.goml b/src/test/rustdoc-gui/settings.goml
index 9a9c45a9b7f..1b2d1e31f52 100644
--- a/src/test/rustdoc-gui/settings.goml
+++ b/src/test/rustdoc-gui/settings.goml
@@ -34,7 +34,7 @@ wait-for: "#settings"
 
 // We check that the "Use system theme" is disabled.
 assert-property: ("#use-system-theme", {"checked": "false"})
-assert: "//*[@class='setting-line']/*[text()='Use system theme']"
+assert: "//*[@class='setting-line']//span[text()='Use system theme']"
 // Meaning that only the "theme" menu is showing up.
 assert: ".setting-line:not(.hidden) #theme"
 assert: ".setting-line.hidden #preferred-dark-theme"
@@ -55,7 +55,13 @@ assert: ".setting-line.hidden #theme"
 assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme")
 assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
 
+// We now check that clicking on the "sliders"' text is like clicking on the slider.
+// To test it, we use the "Disable keyboard shortcuts".
+local-storage: {"rustdoc-disable-shortcuts": "false"}
+click: ".setting-line:last-child .toggle .label"
+assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
+
 // Now we go to the settings page to check that the CSS is loaded as expected.
 goto: file://|DOC_PATH|/settings.html
 wait-for: "#settings"
-assert-css: (".setting-line .toggle", {"width": "45px", "margin-right": "20px"})
+assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"})