mdbook/tests/gui/move-between-pages.goml
Eric Huss dc2fbde515 Harden move-between-pages and sidebar-scroll tests
These tests have been randomly failing on CI. I'm not entirely certain
why there is a race for these conditions. I'm not sure how
browser-ui-test waits when the document reloads on navigation.

There's also some javascript triggers that happen after the page loads,
and I don't remember if that runs before DOMContentLoaded.
2026-04-20 17:16:16 -07:00

43 lines
1.2 KiB
Text

// This tests pressing the left and right arrows moving to previous and next page.
go-to: |DOC_PATH| + "all-summary/index.html"
// default page is the first chapter
wait-for-text: ("title", "Prefix 1 - all-summary")
// Trying to move to the left beyond the prefix pages - nothing changes
press-key: 'ArrowLeft'
wait-for-text: ("title", "Prefix 1 - all-summary")
// Move left
go-to: |DOC_PATH| + "all-summary/intro.html"
wait-for-text: ("title", "Introduction - all-summary")
press-key: 'ArrowLeft'
wait-for-text: ("title", "Prefix 2 - all-summary")
press-key: 'ArrowLeft'
wait-for-text: ("title", "Prefix 1 - all-summary")
// Move right
press-key: 'ArrowRight'
wait-for-text: ("title", "Prefix 2 - all-summary")
press-key: 'ArrowRight'
wait-for-text: ("title", "Introduction - all-summary")
press-key: 'ArrowRight'
wait-for-text: ("title", "P1 C1 - all-summary")
press-key: 'ArrowRight'
wait-for-text: ("title", "P2 C1 - all-summary")
press-key: 'ArrowRight'
wait-for-text: ("title", "Suffix 1 - all-summary")
press-key: 'ArrowRight'
wait-for-text: ("title", "Suffix 2 - all-summary")
// Try to go beyond the last page
press-key: 'ArrowRight'
wait-for-text: ("title", "Suffix 2 - all-summary")