mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 22:58:08 +00:00
## Summary
Adds Playwright coverage for `Preview3D execution` and persistence :
real queue execution against a `Load3D → Preview3D` workflow, plus `save
/ full reload / reopen` from the sidebar.
## What these tests do
**Fixture** (every test)
Turns on Vue Nodes, uses the sidebar for workflows, loads a Load3D →
Preview3D workflow, waits for nodes, then clears saved workflows after
the test so runs stay isolated.
**Test 1 — execution updates Preview3D**
Uploads `cube.obj`(the existing test file in the merged version) to
Load3D, runs `Queue Prompt`, then checks that Preview3D’s model_file and
Last Time Model File match and the canvas has non-zero size. No 3D
screenshots (GPU flakiness).
**Test 2 — persistence after reload**
Same upload + queue, then saves the workflow, reloads the page,
re-applies the same UI settings, opens the saved workflow, and checks
the same model path and camera state (with a small numeric tolerance).
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds new slow, WebGL-dependent E2E tests and fixtures, which can
increase CI runtime and introduce flakiness due to timing/graphics
variability, but does not change production logic.
>
> **Overview**
> Adds a new `Load3D → Preview3D` workflow asset and a dedicated
Playwright fixture (`Preview3DPipelineFixture`) to drive real queue
execution, upload a 3D model, and interact with the 3D canvases (orbit
drags) while asserting `model_file`/`Last Time Model File` and camera
state via node properties.
>
> Introduces camera-state comparison helpers with explicit numeric
tolerances, and adds a new `preview3dExecution.spec.ts` suite that
validates (1) Preview3D updates from execution output and (2) model +
camera persistence across save, full page reload, and reopening the
workflow from the sidebar.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5f54b0f650. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11014-test-add-Preview3D-execution-flow-E2E-tests-33e6d73d3650811fa298c364ae196606)
by [Unito](https://www.unito.io)
---------
Co-authored-by: Terry Jia <terryjia88@gmail.com>
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import {
|
|
preview3dPipelineTest as test,
|
|
Preview3DPipelineContext
|
|
} from '@e2e/fixtures/helpers/Preview3DPipelineFixture'
|
|
|
|
test.describe('Preview3D execution flow', { tag: ['@slow', '@node'] }, () => {
|
|
test('Preview3D loads model from execution output', async ({
|
|
preview3dPipeline: pipeline
|
|
}) => {
|
|
test.setTimeout(120_000)
|
|
|
|
await pipeline.seedLoad3dWithCubeObj()
|
|
await pipeline.queuePromptAndWaitIdle(90_000)
|
|
await pipeline.assertPreview3dExecutionOutputSettled()
|
|
await pipeline.assertPreview3dCanvasNonEmpty()
|
|
})
|
|
|
|
test('Preview3D restores last model and camera after save and full reload', async ({
|
|
preview3dPipeline: pipeline
|
|
}) => {
|
|
test.setTimeout(180_000)
|
|
|
|
await pipeline.seedLoad3dWithCubeObj()
|
|
await pipeline.setNonDefaultLoad3dCameraState()
|
|
await pipeline.queuePromptAndWaitIdle(90_000)
|
|
await pipeline.assertPreview3dExecutionOutputSettled()
|
|
await pipeline.nudgePreview3dCameraIntoProperties()
|
|
|
|
const savedPath = await pipeline.getModelFileWidgetValue(
|
|
Preview3DPipelineContext.previewNodeId
|
|
)
|
|
const savedCamera = await pipeline.getPreview3dCameraStateWhenReady()
|
|
const workflowName =
|
|
await pipeline.saveNamedWorkflowToSidebar('p3d-restore')
|
|
await pipeline.reloadPageAndWaitForAppShell()
|
|
await pipeline.openPersistedWorkflowFromSidebar(workflowName)
|
|
await pipeline.assertPreview3dModelPathAndLastTime(savedPath)
|
|
await pipeline.assertPreview3dCanvasNonEmpty()
|
|
await pipeline.assertPreview3dCameraRestored(savedCamera)
|
|
})
|
|
})
|