Merge pull request #2531 from GuillaumeGomez/regression-test-2529

Add GUI regression test for #2529
This commit is contained in:
Eric Huss 2025-01-23 14:33:22 +00:00 committed by GitHub
commit 0b51a74c16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -4,7 +4,7 @@ on:
merge_group:
env:
BROWSER_UI_TEST_VERSION: '0.18.2'
BROWSER_UI_TEST_VERSION: '0.19.0'
jobs:
test:

View file

@ -75,7 +75,6 @@ fn main() {
let mut command = Command::new("npx");
command
.arg("browser-ui-test")
.arg("--no-sandbox")
.args(["--variable", "DOC_PATH", book_dir.as_str()])
.args(["--test-folder", "tests/gui"]);
if std::env::args().any(|arg| arg == "--disable-headless-test") {

View file

@ -0,0 +1,16 @@
// This GUI test checks that the sidebar takes the whole height when it's inside
// an iframe (because of JS disabled).
// Regression test for <https://github.com/rust-lang/mdBook/issues/2528>.
// We disable the requests checks because `searchindex.json` will always fail
// locally.
fail-on-request-error: false
// We disable javascript
javascript: false
go-to: |DOC_PATH| + "index.html"
store-value: (height, 1000)
set-window-size: (1000, |height|)
within-iframe: (".sidebar-iframe-outer", block {
assert-size: (" body", {"height": |height|})
})