mdbook/tests/gui/move-between-pages.goml
Eric Huss e37e5314f8 Support multiple books in the GUI tests
This adds the ability to use multiple books for the GUI tests. This is
helpful since some tests need special configuration, and sharing the
same book can make it difficult or impossible to test different
configurations. It also makes it difficult to make changes to the
test_book since it can affect other tests.

This works by placing the books in the tests/gui/books directory. The
test runner will automatically build all the books. The gui tests can
then just access the DOC_PATH with the name of the book.

Books are now saved in a temp directory to make it easier to use the
DOC_PATH variable, instead of being tests/gui/books/book_name/book which
is a little awkward.

Following commits will restructure the existing book. This is just a
mechanical move.
2025-10-15 07:00:33 -07:00

36 lines
1.1 KiB
Text

// This tests pressing the left and right arrows moving to previous and next page.
go-to: |DOC_PATH| + "test_book/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: "../last.html"
assert-text: ("title", "Last numbered chapter - 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")