Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions
2181ff9850 [automated] Update test expectations 2026-03-30 03:37:07 +00:00
Terry Jia
83101c8b3e test: add basic E2E tests for Load3D node 2026-03-29 23:30:23 -04:00
5 changed files with 148 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
{
"last_node_id": 1,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "Load3D",
"pos": [50, 50],
"size": [400, 650],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": null
},
{
"name": "MASK",
"type": "MASK",
"links": null
},
{
"name": "MESH",
"type": "MESH",
"links": null
}
],
"properties": {
"Node name for S&R": "Load3D"
},
"widgets_values": ["", 1024, 1024, "#000000"]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {
"ds": {
"offset": [0, 0],
"scale": 1
}
},
"version": 0.4
}

View File

@@ -0,0 +1,101 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
test.describe('Load3D', () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
await comfyPage.workflow.loadWorkflow('3d/load3d_node')
await comfyPage.vueNodes.waitForNodes()
})
test(
'Renders canvas with upload buttons and controls menu',
{ tag: ['@smoke', '@screenshot'] },
async ({ comfyPage }) => {
const node = comfyPage.vueNodes.getNodeLocator('1')
await expect(node).toBeVisible()
await expect(node.locator('canvas')).toBeVisible()
const canvasBox = await node.locator('canvas').boundingBox()
expect(canvasBox!.width).toBeGreaterThan(0)
expect(canvasBox!.height).toBeGreaterThan(0)
await expect(node.getByText('upload 3d model')).toBeVisible()
await expect(node.getByText('upload extra resources')).toBeVisible()
await expect(node.getByText('clear')).toBeVisible()
await expect(node.locator('.pi-bars')).toBeVisible()
await expect(node).toHaveScreenshot('load3d-empty-node.png', {
maxDiffPixelRatio: 0.05
})
}
)
test(
'Controls menu opens and shows all categories',
{ tag: ['@smoke', '@screenshot'] },
async ({ comfyPage }) => {
const node = comfyPage.vueNodes.getNodeLocator('1')
const menuButton = node.locator('.pi-bars')
await menuButton.click()
await expect(node.getByText('Scene', { exact: true })).toBeVisible()
await expect(node.getByText('Model', { exact: true })).toBeVisible()
await expect(node.getByText('Camera', { exact: true })).toBeVisible()
await expect(node.getByText('Light', { exact: true })).toBeVisible()
await expect(node.getByText('Export', { exact: true })).toBeVisible()
await expect(node).toHaveScreenshot('load3d-controls-menu-open.png', {
maxDiffPixelRatio: 0.05
})
}
)
test(
'Changing background color updates the scene',
{ tag: ['@smoke', '@screenshot'] },
async ({ comfyPage }) => {
const node = comfyPage.vueNodes.getNodeLocator('1')
// Scene controls are the default active category — palette button visible
const colorInput = node.locator('input[type="color"]')
await colorInput.evaluate((el) => {
;(el as HTMLInputElement).value = '#cc3333'
el.dispatchEvent(new Event('input', { bubbles: true }))
})
await comfyPage.nextFrame()
await expect
.poll(
() =>
comfyPage.page.evaluate(() => {
const n = window.app!.graph.getNodeById(1)
const config = n?.properties?.['Scene Config'] as
| Record<string, string>
| undefined
return config?.backgroundColor
}),
{ timeout: 3000 }
)
.toBe('#cc3333')
await expect(node).toHaveScreenshot('load3d-red-background.png', {
maxDiffPixelRatio: 0.05
})
}
)
test(
'Recording controls are visible for Load3D',
{ tag: '@smoke' },
async ({ comfyPage }) => {
const node = comfyPage.vueNodes.getNodeLocator('1')
await expect(node.locator('.pi-video')).toBeVisible()
}
)
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB