]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/search-keyboard.goml
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / rustdoc-gui / search-keyboard.goml
1 // Checks that the search tab results work correctly with function signature syntax
2 // First, try a search-by-name
3 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
4 write: (".search-input", "Foo")
5 // To be SURE that the search will be run.
6 press-key: 'Enter'
7 // Waiting for the search results to appear...
8 wait-for: "#search-tabs"
9
10 // Now use the keyboard commands to switch to the third result.
11 press-key: "ArrowDown"
12 press-key: "ArrowDown"
13 press-key: "ArrowDown"
14 assert: ".search-results.active > a:focus:nth-of-type(3)"
15
16 // Now switch to the second tab, then back to the first one, then arrow back up.
17 press-key: "ArrowRight"
18 assert: ".search-results.active:nth-of-type(2) > a:focus:nth-of-type(1)"
19 press-key: "ArrowLeft"
20 assert: ".search-results.active:nth-of-type(1) > a:focus:nth-of-type(3)"
21 press-key: "ArrowUp"
22 assert: ".search-results.active > a:focus:nth-of-type(2)"
23 press-key: "ArrowUp"
24 assert: ".search-results.active > a:focus:nth-of-type(1)"
25 press-key: "ArrowUp"
26 assert: ".search-input:focus"
27 press-key: "ArrowDown"
28 assert: ".search-results.active > a:focus:nth-of-type(1)"