|
| 1 | +// This tests pressing the left and right arrows moving to previous and next page. |
| 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 | + |
| 7 | +go-to: |DOC_PATH| + "index.html" |
| 8 | + |
| 9 | +// default page is the first numbered page |
| 10 | +assert-text: ("title", "Introduction - mdBook test book") |
| 11 | + |
| 12 | +// Moving left we get to the prefix page |
| 13 | +press-key: 'ArrowLeft' |
| 14 | +assert-text: ("title", "Prefix Chapter - mdBook test book") |
| 15 | + |
| 16 | +// Trying to move to the left beyond the prefix pages - nothing changes |
| 17 | +press-key: 'ArrowLeft' |
| 18 | +assert-text: ("title", "Prefix Chapter - mdBook test book") |
| 19 | + |
| 20 | +// Back to the main page |
| 21 | +press-key: 'ArrowRight' |
| 22 | +assert-text: ("title", "Introduction - mdBook test book") |
| 23 | + |
| 24 | +press-key: 'ArrowRight' |
| 25 | +assert-text: ("title", "Markdown Individual tags - mdBook test book") |
| 26 | + |
| 27 | +press-key: 'ArrowRight' |
| 28 | +assert-text: ("title", "Heading - mdBook test book") |
| 29 | + |
| 30 | +// Last numbered page |
| 31 | +go-to: "../rust/rust_codeblock.html" |
| 32 | +assert-text: ("title", "Rust Codeblocks - mdBook test book") |
| 33 | + |
| 34 | +// Go to the suffix chapter |
| 35 | +press-key: 'ArrowRight' |
| 36 | +assert-text: ("title", "Suffix Chapter - mdBook test book") |
| 37 | + |
| 38 | +// Try to go beyond the last page |
| 39 | +press-key: 'ArrowRight' |
| 40 | +assert-text: ("title", "Suffix Chapter - mdBook test book") |
0 commit comments