test: stabilize Preview3D camera state assertion

Use a polling assertion before reading Preview3D camera state so the test waits for async state propagation after execution and avoids null reads in CI.
This commit is contained in:
Kelly Yang
2026-04-10 00:03:36 -07:00
parent fa7477b8c4
commit ea3c289a07

View File

@@ -109,10 +109,19 @@ test.describe('Preview3D execution flow', { tag: ['@node', '@slow'] }, () => {
const savedPath = await pipeline.getModelFileWidgetValue(
Preview3DPipelineContext.previewNodeId
)
await expect
.poll(
() =>
pipeline.getCameraStateFromProperties(
Preview3DPipelineContext.previewNodeId
),
{ timeout: 15_000 }
)
.not.toBeNull()
const savedCamera = await pipeline.getCameraStateFromProperties(
Preview3DPipelineContext.previewNodeId
)
expect(savedCamera, 'Camera state present after execution').not.toBeNull()
const workflowName = `p3d-restore-${Date.now().toString(36)}`
await pipeline.comfyPage.menu.workflowsTab.open()