Skip to content

Commit 148d282

Browse files
committed
Add the ability to pass options to browser-ui-test
This adds the ability to pass options to browser-ui-test, which can help with debugging or doing things like snapshot work. It's maybe not the cleanest since it doesn't support space-separated args, but should be good enough.
1 parent c0dc4b7 commit 148d282

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/gui/runner.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,22 @@ fn main() {
8383

8484
let book_dir = format!("file://{}", current_dir.join("test_book/book/").display());
8585

86-
let mut no_headless = false;
86+
let mut command = Command::new("npx");
87+
command
88+
.arg("browser-ui-test")
89+
.args(["--variable", "DOC_PATH", book_dir.as_str()]);
90+
8791
let mut filters = Vec::new();
8892
for arg in std::env::args().skip(1) {
8993
if arg == "--disable-headless-test" {
90-
no_headless = true;
94+
command.arg("--no-headless");
95+
} else if arg.starts_with("--") {
96+
command.arg(arg);
9197
} else {
9298
filters.push(arg);
9399
}
94100
}
95101

96-
let mut command = Command::new("npx");
97-
command
98-
.arg("browser-ui-test")
99-
.args(["--variable", "DOC_PATH", book_dir.as_str()]);
100-
if no_headless {
101-
command.arg("--no-headless");
102-
}
103-
104102
let test_dir = "tests/gui";
105103
if filters.is_empty() {
106104
command.args(["--test-folder", test_dir]);

0 commit comments

Comments
 (0)