tests: fix rAF-stall flakes in headless chromium; login form submits on Enter
Headless Chromium 151 stops generating animation frames on idle pages, which stalls Playwright's rAF-based waits (wait_for_function default polling, click actionability 'stable' check). Fixes: - wait_for_function: explicit timer polling (100ms/250ms) - video readyState wait: 120s (cold upstream/CDN starts) - .card click: force=True - login: form submit handler (Enter key works, was button-only) - test asserts the seeded entry, not a section header that only appeared via an API-test side effect
This commit is contained in:
1 parent
2efb537edc
commit
2b7eb4cdd1
2 files changed
+19
-11
No files matched your search
+3
-3
@@ -19,7 +19,7 @@ button { width:100%; margin-top:.4rem; padding:.55rem; border:0; border-radius:8
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form onsubmit="return false">
|
||||
<form onsubmit="event.preventDefault(); login()">
|
||||
<h1>ani-web</h1>
|
||||
<input id="user" placeholder="username" autocomplete="username">
|
||||
<input type="password" id="pw" placeholder="password" autocomplete="current-password">
|
||||
@@ -35,7 +35,7 @@ const BASE = (() => {
|
||||
})();
|
||||
const $ = id => document.getElementById(id);
|
||||
const next = new URLSearchParams(location.search).get("next");
|
||||
$("go").onclick = async () => {
|
||||
async function login() {
|
||||
$("err").textContent = "";
|
||||
const r = await fetch(BASE + "login", {method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
@@ -45,7 +45,7 @@ $("go").onclick = async () => {
|
||||
} else {
|
||||
$("err").textContent = (await r.json().catch(() => ({}))).detail || "login failed";
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user