2022-04-30 15:05:40 -05:00
|
|
|
// Checks that the search tab results work correctly with function signature syntax
|
|
|
|
// First, try a search-by-name
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-04-30 15:05:40 -05:00
|
|
|
write: (".search-input", "Foo")
|
2022-07-16 06:53:43 -05:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-04-30 15:05:40 -05:00
|
|
|
// Waiting for the search results to appear...
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
|
|
|
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Names", STARTS_WITH)
|
2022-05-03 11:20:22 -05:00
|
|
|
assert: "input.search-input:focus"
|
2022-05-02 17:50:01 -05:00
|
|
|
// Use left-right keys
|
|
|
|
press-key: "ArrowDown"
|
2022-05-03 11:20:22 -05:00
|
|
|
assert: "#results > .search-results.active > a:nth-of-type(1):focus"
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(2)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowLeft"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected"})
|
2022-04-30 15:05:40 -05:00
|
|
|
|
|
|
|
// Now try search-by-return
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-04-30 15:05:40 -05:00
|
|
|
write: (".search-input", "-> String")
|
2022-07-16 06:53:43 -05:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-04-30 15:05:40 -05:00
|
|
|
// Waiting for the search results to appear...
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
|
|
|
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
|
2022-05-03 11:20:22 -05:00
|
|
|
assert: "input.search-input:focus"
|
2022-05-02 17:50:01 -05:00
|
|
|
// Use left-right keys
|
|
|
|
press-key: "ArrowDown"
|
2022-05-03 11:20:22 -05:00
|
|
|
assert: "#results > .search-results.active > a:nth-of-type(1):focus"
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowRight"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
2022-05-02 17:50:01 -05:00
|
|
|
press-key: "ArrowLeft"
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
2022-04-30 15:05:40 -05:00
|
|
|
|
|
|
|
// Try with a search-by-return with no results
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-04-30 15:05:40 -05:00
|
|
|
write: (".search-input", "-> Something")
|
2022-07-16 06:53:43 -05:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-04-30 15:05:40 -05:00
|
|
|
// Waiting for the search results to appear...
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
|
|
|
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
|
2022-04-30 15:05:40 -05:00
|
|
|
|
2022-05-02 11:45:32 -05:00
|
|
|
// Try with a search-by-parameter
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2023-06-12 09:45:15 -05:00
|
|
|
write: (".search-input", "usize,pattern")
|
2022-07-16 06:53:43 -05:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-04-30 15:05:40 -05:00
|
|
|
// Waiting for the search results to appear...
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
|
|
|
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH)
|
2022-05-02 11:45:32 -05:00
|
|
|
|
|
|
|
// Try with a search-by-parameter-and-return
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-05-02 11:45:32 -05:00
|
|
|
write: (".search-input", "pattern -> str")
|
2022-07-16 06:53:43 -05:00
|
|
|
// To be SURE that the search will be run.
|
|
|
|
press-key: 'Enter'
|
2022-05-02 11:45:32 -05:00
|
|
|
// Waiting for the search results to appear...
|
2022-12-22 16:52:34 -06:00
|
|
|
wait-for: "#search-tabs"
|
|
|
|
assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
|
|
|
|
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Signatures", STARTS_WITH)
|