@@ -4,17 +4,20 @@ goto: file://|DOC_PATH|/test_docs/index.html
44// First, we check that the search results are hidden when the Escape key is pressed.
55write: (".search-input", "test")
66wait-for: "#search h1" // The search element is empty before the first search
7- assert-attribute: ("#search", {"class": "content"})
7+ // Check that the currently displayed element is search.
8+ wait-for: "#alternative-display #search"
89assert-attribute: ("#main-content", {"class": "content hidden"})
910assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
1011press-key: "Escape"
11- assert-attribute: ("#search", {"class": "content hidden"})
12+ // Checks that search is no longer in the displayed content.
13+ wait-for: "#not-displayed #search"
14+ assert-false: "#alternative-display #search"
1215assert-attribute: ("#main-content", {"class": "content"})
1316assert-document-property: ({"URL": "index.html"}, [ENDS_WITH])
1417
1518// Check that focusing the search input brings back the search results
1619focus: ".search-input"
17- assert-attribute: ("# search", {"class": "content"})
20+ wait-for: "#alternative-display # search"
1821assert-attribute: ("#main-content", {"class": "content hidden"})
1922assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
2023
@@ -24,8 +27,8 @@ click: "#help-button"
2427assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
2528assert-attribute: ("#help", {"class": ""})
2629press-key: "Escape"
30+ wait-for: "#alternative-display #search"
2731assert-attribute: ("#help", {"class": "hidden"})
28- assert-attribute: ("#search", {"class": "content"})
2932assert-attribute: ("#main-content", {"class": "content hidden"})
3033assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
3134
@@ -37,5 +40,6 @@ assert-false: ".search-input:focus"
3740assert: "#results a:focus"
3841press-key: "Escape"
3942assert-attribute: ("#help", {"class": "hidden"})
40- assert-attribute: ("#search", {"class": "content hidden"})
43+ wait-for: "#not-displayed #search"
44+ assert-false: "#alternative-display #search"
4145assert-attribute: ("#main-content", {"class": "content"})
0 commit comments