From add1456e94c99c17e41529529e242200a29505c1 Mon Sep 17 00:00:00 2001 From: wangtiance Date: Sat, 21 Nov 2026 22:53:38 +0800 Subject: [PATCH] [test] providers: diagnose video capability generation failures ## summary Capture the second generation submission receipt and print jobs, fixture calls, composer text and page errors when generation fails. The original timeout remains unresolved. ## validation Syntax, Prettier, browser manifest and diff checks passed. Browser attempts did not reach generation. The pre-commit hook was skipped for this commit with explicit user authorization after local Windows permission failures. --- tests/browser/video_capability_roles.mjs | 53 +++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/tests/browser/video_capability_roles.mjs b/tests/browser/video_capability_roles.mjs index b90e32fa0..d36ac34a1 100644 --- a/tests/browser/video_capability_roles.mjs +++ b/tests/browser/video_capability_roles.mjs @@ -316,11 +316,54 @@ try { .locator(`.react-flow__node[data-id="${created.itemId}"]`) .click(); assert.match(await composer.innerText(), /Preserve video draft/); - await composer.locator("button.cw-run-button").click(); - const finished = await until( - () => call(projectPath), - (value) => value.jobs[0]?.status === "succeeded", - ); + let submitReceipt; + let finished; + try { + const [response] = await Promise.all([ + page.waitForResponse( + (response) => + response.url().endsWith(`${projectPath}/commands`) && + response.request().postDataJSON()?.type === "generation.submit", + ), + composer.locator("button.cw-run-button").click(), + ]); + submitReceipt = await response.json(); + assert.equal( + submitReceipt.status, + "applied", + JSON.stringify(submitReceipt), + ); + finished = await until( + () => call(projectPath), + (value) => value.jobs[0]?.status === "succeeded", + ); + } catch (error) { + const diagnostics = await Promise.allSettled([ + call(projectPath), + call("/api/creation-test-health"), + composer.innerText(), + ]); + console.error( + "Video capability generation diagnostics", + JSON.stringify({ + locale, + projectId, + specId: created.specId, + submitReceipt, + pageErrors: errors, + diagnostics: diagnostics.map((result, index) => ({ + source: ["project", "fixtureHealth", "composer"][index], + ...(result.status === "fulfilled" + ? { + value: + index === 0 ? { jobs: result.value.jobs } : result.value, + } + : { error: String(result.reason) }), + })), + }), + ); + throw error; + } assert.equal(finished.jobs[0].inputSnapshot.model.modelId, modelId); assert.equal( finished.jobs[0].inputSnapshot.spec.prompt,