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)
|
||||
// not just the vague "error sending request for url"
|
||||
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: {}",
|
||||
err
|
||||
);
|
||||
|
||||
@@ -3063,12 +3063,17 @@ async fn start_delayed_login_server(
|
||||
setTimeout(() => {{
|
||||
const root = document.getElementById('root');
|
||||
root.innerHTML = `
|
||||
<form id="login-form" onsubmit="event.preventDefault(); window.__submitted = true;">
|
||||
<form id="login-form">
|
||||
<input type="email" name="email" />
|
||||
<input type="password" name="password" />
|
||||
<button type="submit">Sign in</button>
|
||||
</form>
|
||||
`;
|
||||
document.getElementById('login-form').addEventListener('submit', function(e) {{
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.__submitted = true;
|
||||
}});
|
||||
}}, {render_delay_ms});
|
||||
</script>
|
||||
</body>
|
||||
@@ -3865,13 +3870,15 @@ async fn e2e_relaunch_on_options_change() {
|
||||
"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(
|
||||
&json!({
|
||||
"id": "3",
|
||||
"action": "launch",
|
||||
"headless": true,
|
||||
"extensions": ["/tmp/fake-extension"]
|
||||
"userAgent": "agent-browser-test/1.0"
|
||||
}),
|
||||
&mut state,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user