Fix: wait for settled Svelte test variants

Reuse the shared mount-aware cycling helper before subsequent clicks and reload. Keep the DeepSeek request limits scoped to that provider so other provider defaults stay unchanged.

Prepared with AI assistance under maintainer direction.
This commit is contained in:
Paul Bakaus
2026-09-04 19:29:46 -07:00
parent dc5c4b2184
commit cc988144a0
2 changed files with 8 additions and 11 deletions
+2 -2
View File
@@ -620,10 +620,10 @@ export async function createLlmAgent(opts = {}) {
max_tokens: 4096,
system: systemBlocks(STEER_SYSTEM_INSTRUCTIONS),
messages: [{ role: 'user', content: userMessage }],
}, {
}, provider === 'deepseek' ? {
maxRetries: LLM_REQUEST_MAX_RETRIES,
timeout: MANUAL_EDIT_REQUEST_TIMEOUT_MS,
});
} : {});
const cacheRead = response.usage?.cache_read_input_tokens ?? 0;
const inputTokens = response.usage?.input_tokens ?? 0;
+6 -9
View File
@@ -27,7 +27,7 @@ import {
clickExitLiveMode,
clickGo,
clickNext,
clickPrev,
cycleToVariant,
clickSaveEdit,
drawAnnotationPinAndStroke,
editTextLeaf,
@@ -40,6 +40,7 @@ import {
waitForBarHidden,
waitForCycling,
waitForHandshake,
waitForVariantSettled,
} from './live-e2e/ui.mjs';
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -514,14 +515,10 @@ async function clickPendingTrash(page) {
}
async function cycleTo(page, target) {
for (let i = 0; i < 6; i++) {
const visible = await getVisibleVariant(page);
if (visible === target) return;
if (visible == null) await page.waitForTimeout(250);
else if (visible < target) await clickNext(page);
else await clickPrev(page);
}
assert.equal(await getVisibleVariant(page), target, `variant ${target} visible`);
// Component imports finish after the counter changes. Do not send the next
// click (or reload) while the previous variant is still mounting.
await cycleToVariant(page, target, 3);
await waitForVariantSettled(page, target, 3);
}
async function waitForVisibleCycling(page, count, { timeout }) {