Merge pull request #2604 from szabgab/test/arrow-keys
Add GUI test to check the left and right arrow keys
This commit is contained in:
commit
43281c85c5
1 changed files with 40 additions and 0 deletions
40
tests/gui/move-between-pages.goml
Normal file
40
tests/gui/move-between-pages.goml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// This tests pressing the left and right arrows moving to previous and next page.
|
||||
|
||||
// We disable the requests checks because `searchindex.json` will always fail
|
||||
// locally (due to CORS), but the searchindex.js will succeed.
|
||||
fail-on-request-error: false
|
||||
|
||||
go-to: |DOC_PATH| + "index.html"
|
||||
|
||||
// default page is the first numbered page
|
||||
assert-text: ("title", "Introduction - mdBook test book")
|
||||
|
||||
// Moving left we get to the prefix page
|
||||
press-key: 'ArrowLeft'
|
||||
assert-text: ("title", "Prefix Chapter - mdBook test book")
|
||||
|
||||
// Trying to move to the left beyond the prefix pages - nothing changes
|
||||
press-key: 'ArrowLeft'
|
||||
assert-text: ("title", "Prefix Chapter - mdBook test book")
|
||||
|
||||
// Back to the main page
|
||||
press-key: 'ArrowRight'
|
||||
assert-text: ("title", "Introduction - mdBook test book")
|
||||
|
||||
press-key: 'ArrowRight'
|
||||
assert-text: ("title", "Markdown Individual tags - mdBook test book")
|
||||
|
||||
press-key: 'ArrowRight'
|
||||
assert-text: ("title", "Heading - mdBook test book")
|
||||
|
||||
// Last numbered page
|
||||
go-to: "../rust/rust_codeblock.html"
|
||||
assert-text: ("title", "Rust Codeblocks - mdBook test book")
|
||||
|
||||
// Go to the suffix chapter
|
||||
press-key: 'ArrowRight'
|
||||
assert-text: ("title", "Suffix Chapter - mdBook test book")
|
||||
|
||||
// Try to go beyond the last page
|
||||
press-key: 'ArrowRight'
|
||||
assert-text: ("title", "Suffix Chapter - mdBook test book")
|
||||
Loading…
Add table
Reference in a new issue