room e2e: the window's play wait states where the seek back stood, and has the heavy bound #423

Merged
dcharlot merged 1 commit from fix/e2e-window-wait into main 2026-10-21 20:38:00 -04:00

View file

@ -598,9 +598,15 @@ async function seekBackChecks(label, p, principal, dir) {
await until(`${label}: the Seek back control is enabled`, STEP, () => p.evaluate(() => !document.getElementById("seek").disabled), 250);
await p.fill("#seek-s", String(SECONDS));
await p.click("#seek");
const playing = await until(`${label}: ${p.name} plays from the window`, STEP, async () => {
// A FETCH from the window under a loaded host can take a while to start playing, so this
// wait has the bound of the other heavy ones; and while it waits it states the page's
// window mode, view, status and last run, so a timeout says where the seek back stood.
const playing = await until(`${label}: ${p.name} plays from the window`, STEP * 2, async () => {
const s = await p.snap();
return s.dvr.mode === "playing" && !(await p.evaluate(() => document.getElementById("dvr-canvas").hidden)) && s.dvr;
const [hidden, status] = await p.evaluate(() => [document.getElementById("dvr-canvas").hidden, document.getElementById("dvr-status").textContent]);
if (s.dvr.mode === "playing" && !hidden) return s.dvr;
const run = s.dvr.runs && s.dvr.runs[s.dvr.runs.length - 1];
throw new Error(`mode ${s.dvr.mode}, view ${hidden ? "hidden" : "shown"}, status "${(status || "").slice(0, 160)}", last run ${run ? JSON.stringify({ video: run.video, audio: run.audio, playing_at: run.playing_at, live_at: run.live_at }).slice(0, 300) : "none"}`);
}, 100);
check(`${label}: the page shows the window's video in a view of its own while it plays`, playing.runs.length === 1, (await p.evaluate(() => document.getElementById("dvr-status").textContent)).slice(0, 200));
const done = await until(`${label}: ${p.name} returns to live`, STEP * 2, async () => {