MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / config_test

Function config_test

rust/tests/config_tests.rs:34–65  ·  view source on GitHub ↗
(#[case] browser_name: String)

Source from the content-addressed store, hash-verified

32#[case("firefox")]
33#[case("edge")]
34fn config_test(#[case] browser_name: String) {
35 if OS.eq("linux") && ARCH.eq("aarch64") && !browser_name.eq("firefox") {
36 return;
37 }
38 let tmp_dir = Builder::new().prefix("sm-config-test").tempdir().unwrap();
39 let config_path = tmp_dir.path().join("se-config.toml");
40 let config_file = File::create(config_path.as_path()).unwrap();
41 let mut writer = BufWriter::new(config_file);
42 writer
43 .write_all(format!(r#"browser="{}""#, browser_name).as_bytes())
44 .unwrap();
45 writer.flush().unwrap();
46
47 let mut cmd = get_selenium_manager();
48 cmd.env_remove("SE_CACHE_PATH");
49 cmd.args([
50 "--output",
51 "json",
52 "--debug",
53 "--cache-path",
54 tmp_dir.path().to_str().unwrap(),
55 ])
56 .assert()
57 .success()
58 .code(0);
59
60 let stdout = get_stdout(&mut cmd);
61
62 assert!(!stdout.contains("WARN") && !stdout.contains("ERROR"));
63 assert_driver(&mut cmd);
64 assert_browser(&mut cmd);
65}

Callers

nothing calls this directly

Calls 11

createFunction · 0.85
get_selenium_managerFunction · 0.85
get_stdoutFunction · 0.85
assert_driverFunction · 0.85
assert_browserFunction · 0.85
prefixMethod · 0.80
codeMethod · 0.80
argsMethod · 0.80
pathMethod · 0.45
flushMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected