Skip to content

Commit

Permalink
Rollup merge of rust-lang#83754 - GuillaumeGomez:search-tab-behaviour…
Browse files Browse the repository at this point in the history
…, r=jyn514

Add test to ensure search tabs behaviour

It adds a GUI test for rust-lang#80382.

r? ``@jyn514``
  • Loading branch information
JohnTitor authored Apr 2, 2021
2 parents 435e8e8 + f131350 commit 6404a9d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
goto: file://|DOC_PATH|/index.html
write: (".search-input", "Foo")
// Waiting for the search results to appear...
wait-for: "#titles"
assert: ("#titles > button:nth-of-type(1)", "class", "selected")

// To go back to the original "state"
goto: file://|DOC_PATH|/index.html
write: (".search-input", "-> String")
// Waiting for the search results to appear...
wait-for: "#titles"
// With this search, only the last tab shouldn't be empty so it should be selected.
assert: ("#titles > button:nth-of-type(3)", "class", "selected")

// To go back to the original "state"
goto: file://|DOC_PATH|/index.html
write: (".search-input", "-> Something")
// Waiting for the search results to appear...
wait-for: "#titles"
// With this search, all the tabs are empty so the first one should remain selected.
assert: ("#titles > button:nth-of-type(1)", "class", "selected")

0 comments on commit 6404a9d

Please sign in to comment.