From d4699c00a6448970fabe0b2992842f771c1f1ce1 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 27 Oct 2026 03:47:05 +0800 Subject: [PATCH] gui tests: usage-card-refresh reads the refresh button's own path, not the card's first d3191a51c (v0.1.1594) put an account's eye on each Usage card, before the refresh button, so the card's and the row's first became the eye's. usage-card-refresh took that first path for the refresh icon's turn and waited on an animation the eye never has: red in chromium and webkit at d3191a51c, green at 0f6615ffc, run alone. It now names .quota-refresh path, as the page itself does (the refresh animates b.querySelector("path") on the button). No other test reads a card's or an account row's first path (grep of tests/*.cjs). Run (macOS, playwright 1.62.0, at 84bc5fdad plus this): - usage-card-refresh.test.cjs: 46/46 twice, both engines; red before this at d3191a51c (2 of 46, the waitForFunction at :239). Found by the whole GUI suite at d3191a51c: 12,984 tests, 201 reds under a shared machine (load ~120); the 58 red files rerun alone gave 27 red, and each was rerun on 0f6615ffc, the main before the eye. Only this file was red at d3191a51c and green at 0f6615ffc on a serial rerun; context-map at 420px is red now and then on both (1 of 3 each). go test ./internal/gui at d3191a51c: ok. --- internal/gui/tests/usage-card-refresh.test.cjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/gui/tests/usage-card-refresh.test.cjs b/internal/gui/tests/usage-card-refresh.test.cjs index 047664540..a8262dfa9 100644 --- a/internal/gui/tests/usage-card-refresh.test.cjs +++ b/internal/gui/tests/usage-card-refresh.test.cjs @@ -221,7 +221,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", releaseRead(); await page.evaluate(() => quotasLoading); assert.equal(await row.evaluate(e => e.querySelector(".quota-refresh") === window.refreshMotion.button), true, "a background reading replaced the spinning control"); - assert.equal(await row.evaluate(e => e.querySelector("path").getAnimations()[0] === window.refreshMotion.animation), true, "a background reading restarted the turn"); + assert.equal(await row.evaluate(e => e.querySelector(".quota-refresh path").getAnimations()[0] === window.refreshMotion.animation), true, "a background reading restarted the turn"); release(); await page.locator('.subscription-card[data-provider="codex"] .quota-n', { hasText: "61%" }).waitFor(); const end = await row.evaluate(e => { @@ -236,8 +236,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", // A response already available still gets one complete turn. state.gate = undefined; await row.locator(".quota-refresh").click(); - await page.waitForFunction(() => document.querySelector('.subscription-card[data-provider="codex"] path').getAnimations()[0]?.effect.getTiming().iterations === 1); - await row.evaluate(e => e.querySelector("path").getAnimations()[0].finish()); + await page.waitForFunction(() => document.querySelector('.subscription-card[data-provider="codex"] .quota-refresh path').getAnimations()[0]?.effect.getTiming().iterations === 1); + await row.evaluate(e => e.querySelector(".quota-refresh path").getAnimations()[0].finish()); await row.locator(".quota-refresh:not(.busy)").waitFor(); assert.deepEqual(errors, []); });