]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-gui/escape-key.goml
Update unsuspicious file list
[rustc.git] / src / test / rustdoc-gui / escape-key.goml
CommitLineData
5099ac24
FG
1// This test ensures that the "Escape" shortcut is handled correctly based on the
2// current content displayed.
2b03887a 3goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
136023e0
XL
4// First, we check that the search results are hidden when the Escape key is pressed.
5write: (".search-input", "test")
064997fb
FG
6// To be SURE that the search will be run.
7press-key: 'Enter'
5099ac24 8wait-for: "#search h1" // The search element is empty before the first search
04454e1e
FG
9// Check that the currently displayed element is search.
10wait-for: "#alternative-display #search"
a2a8927a 11assert-attribute: ("#main-content", {"class": "content hidden"})
5e7ed085 12assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
136023e0 13press-key: "Escape"
04454e1e
FG
14// Checks that search is no longer in the displayed content.
15wait-for: "#not-displayed #search"
16assert-false: "#alternative-display #search"
a2a8927a 17assert-attribute: ("#main-content", {"class": "content"})
5e7ed085 18assert-document-property: ({"URL": "index.html"}, [ENDS_WITH])
136023e0
XL
19
20// Check that focusing the search input brings back the search results
21focus: ".search-input"
04454e1e 22wait-for: "#alternative-display #search"
a2a8927a 23assert-attribute: ("#main-content", {"class": "content hidden"})
5e7ed085 24assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
136023e0 25
136023e0
XL
26// Check that Escape hides the search results when a search result is focused.
27focus: ".search-input"
28assert: ".search-input:focus"
29press-key: "ArrowDown"
30assert-false: ".search-input:focus"
31assert: "#results a:focus"
32press-key: "Escape"
04454e1e
FG
33wait-for: "#not-displayed #search"
34assert-false: "#alternative-display #search"
a2a8927a 35assert-attribute: ("#main-content", {"class": "content"})