Skip to content

Commit 43281c8

Browse files
authored
Merge pull request #2604 from szabgab/test/arrow-keys
Add GUI test to check the left and right arrow keys
2 parents e73d3b7 + 1de8cf8 commit 43281c8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/gui/move-between-pages.goml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

Comments
 (0)