Files
mdBook/tests/gui/redirect.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

42 lines
2.3 KiB
Plaintext

go-to: |DOC_PATH| + "test_book/format/config.html"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
// Check that it preserves fragments when redirecting.
go-to: |DOC_PATH| + "test_book/format/config.html#fragment"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#fragment"})
// The fragment one here isn't necessary, but should still work.
go-to: |DOC_PATH| + "test_book/pointless-fragment.html"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
go-to: |DOC_PATH| + "test_book/pointless-fragment.html#foo"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#foo"})
// Page rename, and a fragment rename.
go-to: |DOC_PATH| + "test_book/rename-page-and-fragment.html"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
go-to: |DOC_PATH| + "test_book/rename-page-and-fragment.html#orig"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#new"})
// Page rename, and the fragment goes to a *different* page from the default.
go-to: |DOC_PATH| + "test_book/rename-page-fragment-elsewhere.html"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
go-to: |DOC_PATH| + "test_book/rename-page-fragment-elsewhere.html#orig"
assert-window-property: ({"location": |DOC_PATH| + "test_book/suffix.html#new"})
// Rename fragment on an existing page.
go-to: |DOC_PATH| + "test_book/prefix.html#orig"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#new"})
// Other fragments aren't affected.
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
go-to: |DOC_PATH| + "test_book/prefix.html"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html"})
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
go-to: |DOC_PATH| + "test_book/prefix.html#dont-change"
assert-window-property: ({"location": |DOC_PATH| + "test_book/prefix.html#dont-change"})
// Rename fragment on an existing page to another page.
go-to: |DOC_PATH| + "test_book/index.html" // Reset page since redirects are processed on load.
go-to: |DOC_PATH| + "test_book/prefix.html#orig-new-page"
assert-window-property: ({"location": |DOC_PATH| + "test_book/suffix.html#new"})