|
| 1 | +// This tests basic search behavior. |
| 2 | + |
| 3 | +// We disable the requests checks because `searchindex.json` will always fail |
| 4 | +// locally (due to CORS), but the searchindex.js will succeed. |
| 5 | +fail-on-request-error: false |
| 6 | +go-to: |DOC_PATH| + "index.html" |
| 7 | + |
| 8 | +define-function: ( |
| 9 | + "open-search", |
| 10 | + [], |
| 11 | + block { |
| 12 | + assert-css: ("#search-wrapper", {"display": "none"}) |
| 13 | + press-key: 'S' |
| 14 | + wait-for-css-false: ("#search-wrapper", {"display": "none"}) |
| 15 | + } |
| 16 | +) |
| 17 | + |
| 18 | +call-function: ("open-search", {}) |
| 19 | +assert-text: ("#searchresults-header", "") |
| 20 | +write: "strikethrough" |
| 21 | +wait-for-text: ("#searchresults-header", "2 search results for 'strikethrough':") |
| 22 | +// Close the search display |
| 23 | +press-key: 'Escape' |
| 24 | +wait-for-css: ("#search-wrapper", {"display": "none"}) |
| 25 | +// Reopening the search should show the last value |
| 26 | +call-function: ("open-search", {}) |
| 27 | +assert-text: ("#searchresults-header", "2 search results for 'strikethrough':") |
| 28 | +// Navigate to a sub-chapter |
| 29 | +go-to: "./individual/strikethrough.html" |
| 30 | +assert-text: ("#searchresults-header", "") |
| 31 | +call-function: ("open-search", {}) |
| 32 | +write: "strikethrough" |
| 33 | +wait-for-text: ("#searchresults-header", "2 search results for 'strikethrough':") |
0 commit comments