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

Function config_test

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

Source from the content-addressed store, hash-verified

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

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