Skip to content

Commit c9293bf

Browse files
committed
rustdoc-search: add test case for throbber
1 parent 6d4b4d9 commit c9293bf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// We are intentionally triggering errors for race-free throbber test
2+
fail-on-request-error: false
3+
fail-on-js-error: false
4+
5+
// First, make sure the throbber goes away when done
6+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search="
7+
wait-for: ".search-input"
8+
wait-for-false: ".search-form.loading"
9+
write-into: (".search-input", "test")
10+
press-key: 'Enter'
11+
wait-for-false: ".search-form.loading"
12+
13+
// Make sure the throbber shows up if we prevent the search from
14+
// ever finishing (this tactic is needed to make sure we don't get stuck
15+
// with any race conditions).
16+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search="
17+
block-network-request: "*/desc/*.js"
18+
reload:
19+
wait-for: ".search-input"
20+
wait-for-false: ".search-form.loading"
21+
write-into: (".search-input", "test")
22+
press-key: 'Enter'
23+
wait-for: ".search-form.loading"

0 commit comments

Comments
 (0)