Skip to content

Commit 372271e

Browse files
Add URL GUI tests
1 parent 8a7b83a commit 372271e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: src/test/rustdoc-gui/escape-key.goml

+5
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ write: (".search-input", "test")
66
wait-for: "#search h1" // The search element is empty before the first search
77
assert-attribute: ("#search", {"class": "content"})
88
assert-attribute: ("#main-content", {"class": "content hidden"})
9+
assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
910
press-key: "Escape"
1011
assert-attribute: ("#search", {"class": "content hidden"})
1112
assert-attribute: ("#main-content", {"class": "content"})
13+
assert-document-property: ({"URL": "index.html"}, [ENDS_WITH])
1214

1315
// Check that focusing the search input brings back the search results
1416
focus: ".search-input"
1517
assert-attribute: ("#search", {"class": "content"})
1618
assert-attribute: ("#main-content", {"class": "content hidden"})
19+
assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
1720

1821
// Now let's check that when the help popup is displayed and we press Escape, it doesn't
1922
// hide the search results too.
2023
click: "#help-button"
24+
assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
2125
assert-attribute: ("#help", {"class": ""})
2226
press-key: "Escape"
2327
assert-attribute: ("#help", {"class": "hidden"})
2428
assert-attribute: ("#search", {"class": "content"})
2529
assert-attribute: ("#main-content", {"class": "content hidden"})
30+
assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
2631

2732
// Check that Escape hides the search results when a search result is focused.
2833
focus: ".search-input"

Diff for: src/test/rustdoc-gui/search-filter.goml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ press-key: "ArrowDown"
1515
press-key: "Enter"
1616
// Waiting for the search results to appear...
1717
wait-for: "#titles"
18+
assert-document-property: ({"URL": "&filter-crate="}, CONTAINS)
1819
// We check that there is no more "test_docs" appearing.
1920
assert-false: "#results .externcrate"
2021
// We also check that "lib2" is the filter crate.

0 commit comments

Comments
 (0)