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

Function assert_output

rust/tests/common.rs:109–130  ·  view source on GitHub ↗
(
    cmd: &mut Command,
    assert_result: AssertResult,
    expected_output: Vec<&str>,
    error_code: i32,
)

Source from the content-addressed store, hash-verified

107
108#[allow(dead_code)]
109pub fn assert_output(
110 cmd: &mut Command,
111 assert_result: AssertResult,
112 expected_output: Vec<&str>,
113 error_code: i32,
114) {
115 if assert_result.is_ok() {
116 let stdout = &cmd.unwrap().stdout;
117 let output = std::str::from_utf8(stdout).unwrap();
118 expected_output
119 .iter()
120 .for_each(|o| assert!(output.contains(o)));
121 } else {
122 assert!(
123 assert_result
124 .err()
125 .unwrap()
126 .to_string()
127 .contains(&error_code.to_string())
128 );
129 }
130}

Callers 6

wrong_proxy_testFunction · 0.85
wrong_port_proxy_testFunction · 0.85
grid_error_testFunction · 0.85
wrong_parameters_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected