]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
Merge 'rust-clippy/master' into clippyup
[rust.git] / src / test / rustdoc-gui / search-tab-change-title-fn-sig.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 // Waiting for the search results to appear...
6 wait-for: "#titles"
7 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
8 assert-text: ("#titles > button:nth-of-type(1)", "In Names", STARTS_WITH)
9 assert: "input.search-input:focus"
10 // Use left-right keys
11 press-key: "ArrowDown"
12 assert: "#results > .search-results.active > a:nth-of-type(1):focus"
13 press-key: "ArrowRight"
14 wait-for-attribute: ("#titles > button:nth-of-type(2)", {"class": "selected"})
15 press-key: "ArrowRight"
16 wait-for-attribute: ("#titles > button:nth-of-type(3)", {"class": "selected"})
17 press-key: "ArrowRight"
18 wait-for-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
19 press-key: "ArrowLeft"
20 wait-for-attribute: ("#titles > button:nth-of-type(3)", {"class": "selected"})
21
22 // Now try search-by-return
23 goto: file://|DOC_PATH|/test_docs/index.html
24 write: (".search-input", "-> String")
25 // Waiting for the search results to appear...
26 wait-for: "#titles"
27 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
28 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
29 assert: "input.search-input:focus"
30 // Use left-right keys
31 press-key: "ArrowDown"
32 assert: "#results > .search-results.active > a:nth-of-type(1):focus"
33 press-key: "ArrowRight"
34 wait-for-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
35 press-key: "ArrowRight"
36 wait-for-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
37 press-key: "ArrowRight"
38 wait-for-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
39 press-key: "ArrowLeft"
40 wait-for-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
41
42 // Try with a search-by-return with no results
43 goto: file://|DOC_PATH|/test_docs/index.html
44 write: (".search-input", "-> Something")
45 // Waiting for the search results to appear...
46 wait-for: "#titles"
47 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
48 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
49
50 // Try with a search-by-parameter
51 goto: file://|DOC_PATH|/test_docs/index.html
52 write: (".search-input", "usize pattern")
53 // Waiting for the search results to appear...
54 wait-for: "#titles"
55 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
56 assert-text: ("#titles > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH)
57
58 // Try with a search-by-parameter-and-return
59 goto: file://|DOC_PATH|/test_docs/index.html
60 write: (".search-input", "pattern -> str")
61 // Waiting for the search results to appear...
62 wait-for: "#titles"
63 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
64 assert-text: ("#titles > button:nth-of-type(1)", "In Function Signatures", STARTS_WITH)