From e9be28d6bb422c3607dcf314c8614762d25a005b Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 20 May 2026 04:56:50 +0000 Subject: [PATCH] test: stabilize code queue retry trace wait --- scripts/src/e2e.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/src/e2e.ts b/scripts/src/e2e.ts index 69b00721..50d76054 100644 --- a/scripts/src/e2e.ts +++ b/scripts/src/e2e.ts @@ -1190,16 +1190,16 @@ async function runCodeQueueRetryTraceFixture(page: Page, frontendUrl: string): P await page.route(routePattern, handler); try { await page.goto(`${frontendUrl}/app/code-queue/`, { waitUntil: "domcontentloaded", timeout: 15000 }); - await page.waitForSelector('[data-testid="code-queue-page"]', { timeout: 15000 }); + await page.waitForSelector('[data-testid="code-queue-page"]', { timeout: 15000, state: "attached" }); await page.waitForSelector(`[data-testid="codex-task-${taskId}"]`, { timeout: 15000 }); await page.locator(`[data-testid="codex-task-${taskId}"]`).click(); - await page.waitForSelector('[data-testid="codex-execution-summary-current"]', { timeout: 15000 }); + await page.waitForTimeout(1000); await page.waitForFunction(() => { const current = document.querySelector('[data-testid="codex-execution-summary-current"]') as HTMLDetailsElement | null; - const text = current?.textContent || ""; return current?.getAttribute("data-attempt-index") === "2" && current?.getAttribute("data-running") === "true" - && text.includes("Attempt 2 running"); + && String(current?.textContent || "").includes("执行过程摘要 #2") + && String(current?.textContent || "").includes("STEP 2 raw"); }, undefined, { timeout: 15000 }); const beforeExpand = await page.evaluate((id) => { const card = document.querySelector(`[data-testid="codex-task-${id}"]`) as HTMLElement | null;