fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// Checks that the search tab results work correctly with function signature syntax 2// First, try a search-by-name 3go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" 4write: (".search-input", "Foo") 5// To be SURE that the search will be run. 6press-key: 'Enter' 7// Waiting for the search results to appear... 8wait-for: "#search-tabs" 9assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 10assert-text: ("#search-tabs > button:nth-of-type(1)", "In Names", STARTS_WITH) 11assert: "input.search-input:focus" 12// Use left-right keys 13press-key: "ArrowDown" 14assert: "#results > .search-results.active > a:nth-of-type(1):focus" 15press-key: "ArrowRight" 16wait-for-attribute: ("#search-tabs > button:nth-of-type(2)", {"class": "selected"}) 17press-key: "ArrowRight" 18wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected"}) 19press-key: "ArrowRight" 20wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 21press-key: "ArrowLeft" 22wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected"}) 23 24// Now try search-by-return 25go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" 26write: (".search-input", "-> String") 27// To be SURE that the search will be run. 28press-key: 'Enter' 29// Waiting for the search results to appear... 30wait-for: "#search-tabs" 31assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 32assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH) 33assert: "input.search-input:focus" 34// Use left-right keys 35press-key: "ArrowDown" 36assert: "#results > .search-results.active > a:nth-of-type(1):focus" 37press-key: "ArrowRight" 38wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 39press-key: "ArrowRight" 40wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 41press-key: "ArrowRight" 42wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 43press-key: "ArrowLeft" 44wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 45 46// Try with a search-by-return with no results 47go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" 48write: (".search-input", "-> Something") 49// To be SURE that the search will be run. 50press-key: 'Enter' 51// Waiting for the search results to appear... 52wait-for: "#search-tabs" 53assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 54assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH) 55 56// Try with a search-by-parameter 57go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" 58write: (".search-input", "usize,pattern") 59// To be SURE that the search will be run. 60press-key: 'Enter' 61// Waiting for the search results to appear... 62wait-for: "#search-tabs" 63assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 64assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH) 65 66// Try with a search-by-parameter-and-return 67go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" 68write: (".search-input", "pattern -> str") 69// To be SURE that the search will be run. 70press-key: 'Enter' 71// Waiting for the search results to appear... 72wait-for: "#search-tabs" 73assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}) 74assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Signatures", STARTS_WITH)