about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-03-15 20:56:14 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-03-15 20:56:14 +0100
commit372271e3dd5dce4ff5de7861f3b281d7a092343f (patch)
treec7ad45c0266f85f419d5989e197bcc3b4455e945
parent8a7b83a24a6dfe71687092ad55bbd0cfae82c201 (diff)
downloadrust-372271e3dd5dce4ff5de7861f3b281d7a092343f.tar.gz
rust-372271e3dd5dce4ff5de7861f3b281d7a092343f.zip
Add URL GUI tests
-rw-r--r--src/test/rustdoc-gui/escape-key.goml5
-rw-r--r--src/test/rustdoc-gui/search-filter.goml1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/escape-key.goml b/src/test/rustdoc-gui/escape-key.goml
index 9cff12f3e41..6e305e81eee 100644
--- a/src/test/rustdoc-gui/escape-key.goml
+++ b/src/test/rustdoc-gui/escape-key.goml
@@ -6,23 +6,28 @@ write: (".search-input", "test")
 wait-for: "#search h1" // The search element is empty before the first search 
 assert-attribute: ("#search", {"class": "content"})
 assert-attribute: ("#main-content", {"class": "content hidden"})
+assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
 press-key: "Escape"
 assert-attribute: ("#search", {"class": "content hidden"})
 assert-attribute: ("#main-content", {"class": "content"})
+assert-document-property: ({"URL": "index.html"}, [ENDS_WITH])
 
 // Check that focusing the search input brings back the search results
 focus: ".search-input"
 assert-attribute: ("#search", {"class": "content"})
 assert-attribute: ("#main-content", {"class": "content hidden"})
+assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
 
 // Now let's check that when the help popup is displayed and we press Escape, it doesn't
 // hide the search results too.
 click: "#help-button"
+assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
 assert-attribute: ("#help", {"class": ""})
 press-key: "Escape"
 assert-attribute: ("#help", {"class": "hidden"})
 assert-attribute: ("#search", {"class": "content"})
 assert-attribute: ("#main-content", {"class": "content hidden"})
+assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
 
 // Check that Escape hides the search results when a search result is focused.
 focus: ".search-input"
diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml
index 73d310fc5c9..3f78d60f28c 100644
--- a/src/test/rustdoc-gui/search-filter.goml
+++ b/src/test/rustdoc-gui/search-filter.goml
@@ -15,6 +15,7 @@ press-key: "ArrowDown"
 press-key: "Enter"
 // Waiting for the search results to appear...
 wait-for: "#titles"
+assert-document-property: ({"URL": "&filter-crate="}, CONTAINS)
 // We check that there is no more "test_docs" appearing.
 assert-false: "#results .externcrate"
 // We also check that "lib2" is the filter crate.