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...
7 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
8 assert-text: ("#titles > button:nth-of-type(1)", "In Names", STARTS_WITH)
10 // Now try search-by-return
11 goto: file://|DOC_PATH|/test_docs/index.html
12 write: (".search-input", "-> String")
13 // Waiting for the search results to appear...
15 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
16 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
18 // Try with a search-by-return with no results
19 goto: file://|DOC_PATH|/test_docs/index.html
20 write: (".search-input", "-> Something")
21 // Waiting for the search results to appear...
23 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
24 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
26 // Try with a search-by-parameter
27 goto: file://|DOC_PATH|/test_docs/index.html
28 write: (".search-input", "usize pattern")
29 // Waiting for the search results to appear...
31 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
32 assert-text: ("#titles > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH)
34 // Try with a search-by-parameter-and-return
35 goto: file://|DOC_PATH|/test_docs/index.html
36 write: (".search-input", "pattern -> str")
37 // Waiting for the search results to appear...
39 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
40 assert-text: ("#titles > button:nth-of-type(1)", "In Function Signatures", STARTS_WITH)