test: stabilize code queue retry trace wait

This commit is contained in:
Codex
2026-05-20 04:56:50 +00:00
parent d2618f7409
commit e9be28d6bb
+4 -4
View File
@@ -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;