Skip to content

Commit 8c11846

Browse files
committed
Add WASM_BINDGEN_WEBDRIVER_JSON var to override webdriver.json path
1 parent c35cc93 commit 8c11846

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,17 @@ pub fn run(
126126
session: None,
127127
};
128128
println!("Try find `webdriver.json` for configure browser's capabilities:");
129-
let capabilities: Capabilities = match File::open("webdriver.json") {
130-
Ok(file) => {
131-
println!("Ok");
132-
serde_json::from_reader(file)
133-
}
134-
Err(_) => {
135-
println!("Not found");
136-
Ok(Capabilities::new())
137-
}
138-
}?;
129+
let capabilities: Capabilities =
130+
match File::open(std::env::var("WASM_BINDGEN_WEBDRIVER_JSON").unwrap_or("webdriver.json".to_string())) {
131+
Ok(file) => {
132+
println!("Ok");
133+
serde_json::from_reader(file)
134+
}
135+
Err(_) => {
136+
println!("Not found");
137+
Ok(Capabilities::new())
138+
}
139+
}?;
139140
shell.status("Starting new webdriver session...");
140141
// Allocate a new session with the webdriver protocol, and once we've done
141142
// so schedule the browser to get closed with a call to `close_window`.

0 commit comments

Comments
 (0)