mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-13 06:36:26 +03:00
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:
@@ -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;
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user