@@ -4,17 +4,20 @@ goto: file://|DOC_PATH|/test_docs/index.html
4
4
// First, we check that the search results are hidden when the Escape key is pressed.
5
5
write: (".search-input", "test")
6
6
wait-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"
8
9
assert-attribute: ("#main-content", {"class": "content hidden"})
9
10
assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
10
11
press-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"
12
15
assert-attribute: ("#main-content", {"class": "content"})
13
16
assert-document-property: ({"URL": "index.html"}, [ENDS_WITH])
14
17
15
18
// Check that focusing the search input brings back the search results
16
19
focus: ".search-input"
17
- assert-attribute: ("# search", {"class": "content"})
20
+ wait-for: "#alternative-display # search"
18
21
assert-attribute: ("#main-content", {"class": "content hidden"})
19
22
assert-document-property: ({"URL": "index.html?search=test"}, ENDS_WITH)
20
23
@@ -24,8 +27,8 @@ click: "#help-button"
24
27
assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
25
28
assert-attribute: ("#help", {"class": ""})
26
29
press-key: "Escape"
30
+ wait-for: "#alternative-display #search"
27
31
assert-attribute: ("#help", {"class": "hidden"})
28
- assert-attribute: ("#search", {"class": "content"})
29
32
assert-attribute: ("#main-content", {"class": "content hidden"})
30
33
assert-document-property: ({"URL": "index.html?search=test"}, [ENDS_WITH])
31
34
@@ -37,5 +40,6 @@ assert-false: ".search-input:focus"
37
40
assert: "#results a:focus"
38
41
press-key: "Escape"
39
42
assert-attribute: ("#help", {"class": "hidden"})
40
- assert-attribute: ("#search", {"class": "content hidden"})
43
+ wait-for: "#not-displayed #search"
44
+ assert-false: "#alternative-display #search"
41
45
assert-attribute: ("#main-content", {"class": "content"})
0 commit comments