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 <path> 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 atd3191a51c, green at0f6615ffc, 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, at84bc5fdadplus this): - usage-card-refresh.test.cjs: 46/46 twice, both engines; red before this atd3191a51c(2 of 46, the waitForFunction at :239). Found by the whole GUI suite atd3191a51c: 12,984 tests, 201 reds under a shared machine (load ~120); the 58 red files rerun alone gave 27 red, and each was rerun on0f6615ffc, the main before the eye. Only this file was red atd3191a51cand green at0f6615ffcon a serial rerun; context-map at 420px is red now and then on both (1 of 3 each). go test ./internal/gui atd3191a51c: ok.
This commit is contained in:
@@ -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, []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user