fix: CI test failures on Windows and E2E (#1165)
- Windows: match "actively refused it" error message in download_bytes_connection_refused test (os error 10061) - E2E relaunch: use userAgent instead of extensions to trigger relaunch, since extensions force headed mode which requires a display server unavailable in CI - E2E auth_login SPA: use addEventListener instead of inline onsubmit for more reliable form submission prevention
This commit is contained in:
+3
-1
@@ -1029,7 +1029,9 @@ mod tests {
|
|||||||
// The new code should include the root cause (connection refused)
|
// The new code should include the root cause (connection refused)
|
||||||
// not just the vague "error sending request for url"
|
// not just the vague "error sending request for url"
|
||||||
assert!(
|
assert!(
|
||||||
err.contains("Connection refused") || err.contains("connection refused"),
|
err.contains("Connection refused")
|
||||||
|
|| err.contains("connection refused")
|
||||||
|
|| err.contains("actively refused it"),
|
||||||
"expected 'connection refused' in error, got: {}",
|
"expected 'connection refused' in error, got: {}",
|
||||||
err
|
err
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3063,12 +3063,17 @@ async fn start_delayed_login_server(
|
|||||||
setTimeout(() => {{
|
setTimeout(() => {{
|
||||||
const root = document.getElementById('root');
|
const root = document.getElementById('root');
|
||||||
root.innerHTML = `
|
root.innerHTML = `
|
||||||
<form id="login-form" onsubmit="event.preventDefault(); window.__submitted = true;">
|
<form id="login-form">
|
||||||
<input type="email" name="email" />
|
<input type="email" name="email" />
|
||||||
<input type="password" name="password" />
|
<input type="password" name="password" />
|
||||||
<button type="submit">Sign in</button>
|
<button type="submit">Sign in</button>
|
||||||
</form>
|
</form>
|
||||||
`;
|
`;
|
||||||
|
document.getElementById('login-form').addEventListener('submit', function(e) {{
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
window.__submitted = true;
|
||||||
|
}});
|
||||||
}}, {render_delay_ms});
|
}}, {render_delay_ms});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
@@ -3865,13 +3870,15 @@ async fn e2e_relaunch_on_options_change() {
|
|||||||
"identical options must reuse the browser"
|
"identical options must reuse the browser"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Third launch — different options (extensions added) → must relaunch, not reuse.
|
// Third launch — different options (userAgent changed) → must relaunch, not reuse.
|
||||||
|
// We use userAgent instead of extensions because extensions force headed mode,
|
||||||
|
// which requires a display server and fails in headless CI environments.
|
||||||
let resp = execute_command(
|
let resp = execute_command(
|
||||||
&json!({
|
&json!({
|
||||||
"id": "3",
|
"id": "3",
|
||||||
"action": "launch",
|
"action": "launch",
|
||||||
"headless": true,
|
"headless": true,
|
||||||
"extensions": ["/tmp/fake-extension"]
|
"userAgent": "agent-browser-test/1.0"
|
||||||
}),
|
}),
|
||||||
&mut state,
|
&mut state,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user