mirror of
https://github.com/rust-lang/mdBook.git
synced 2025-12-27 10:16:09 -05:00
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.
20 lines
862 B
Plaintext
20 lines
862 B
Plaintext
// When a header has various markup, the sidebar should replicate it.
|
|
|
|
set-window-size: (1400, 800)
|
|
go-to: |DOC_PATH| + "test_book/headings/markup.html"
|
|
|
|
assert-count: (".header-item", 5)
|
|
assert-count: (".current-header", 1)
|
|
assert-text: (".current-header", "Heading with code or italic or bold or strike")
|
|
assert-property: (".current-header", {"innerHTML": "Heading with <code>code</code> or <em>italic</em> or <strong>bold</strong> or <del>strike</del>"})
|
|
|
|
// Clicking the custom one should work and should make it current.
|
|
click: "a.header-in-summary[href='#custom-id']"
|
|
assert-count: (".current-header", 1)
|
|
assert-text: (".current-header", "Heading with a custom id")
|
|
|
|
// Click the one with HTML, and check it.
|
|
click: "a.header-in-summary[href='#heading-with-html']"
|
|
assert-count: (".current-header", 1)
|
|
assert-text: (".current-header", "Heading with html")
|