Files
ComfyUI_frontend/browser_tests/tests/vueNodes/interactions/node/nodeOutputPreservation.spec.ts
bymyself 3f0937e688 test: rewrite E2E output preservation tests to use widget values
Replace drag-and-drop image preview tests (broken in CI per #8143) with
execution-based widget value assertions using the partial_execution
workflow. Tests the same changeTracker snapshot/restore path through
PreviewAny widget values, which work reliably in CI.
2026-03-07 22:01:02 -08:00

75 lines
2.4 KiB
TypeScript

import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '../../../../fixtures/ComfyPage'
test.describe(
'Node Output Preservation',
{ tag: ['@widget', '@node'] },
() => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
await comfyPage.settings.setSetting(
'Comfy.Workflow.WorkflowTabsPosition',
'Topbar'
)
})
test('Execution output widget value survives tab switch', async ({
comfyPage
}) => {
await comfyPage.workflow.loadWorkflow('execution/partial_execution')
const outputNode = await comfyPage.nodeOps.getNodeRefById(1)
expect(await (await outputNode.getWidget(0)).getValue()).toBe('')
await comfyPage.command.executeCommand('Comfy.QueuePrompt')
await expect(async () => {
expect(await (await outputNode.getWidget(0)).getValue()).toBe('foo')
}).toPass({ timeout: 5_000 })
await comfyPage.menu.topbar.triggerTopbarCommand(['New'])
await comfyPage.nextFrame()
const firstTab = comfyPage.menu.topbar.getWorkflowTab(
'partial_execution'
)
await firstTab.click()
await comfyPage.nextFrame()
await expect(async () => {
expect(await (await outputNode.getWidget(0)).getValue()).toBe('foo')
}).toPass({ timeout: 5_000 })
})
test('Outputs on different tabs are independent', async ({
comfyPage
}) => {
await comfyPage.workflow.loadWorkflow('execution/partial_execution')
const outputNode1 = await comfyPage.nodeOps.getNodeRefById(1)
await comfyPage.command.executeCommand('Comfy.QueuePrompt')
await expect(async () => {
expect(await (await outputNode1.getWidget(0)).getValue()).toBe('foo')
}).toPass({ timeout: 5_000 })
await comfyPage.menu.topbar.triggerTopbarCommand(['New'])
await comfyPage.nextFrame()
const newOutputCount = await comfyPage.page.evaluate(
() => Object.keys(window.app!.nodeOutputs).length
)
expect(newOutputCount).toBe(0)
const firstTab = comfyPage.menu.topbar.getWorkflowTab(
'partial_execution'
)
await firstTab.click()
await comfyPage.nextFrame()
await expect(async () => {
expect(await (await outputNode1.getWidget(0)).getValue()).toBe('foo')
}).toPass({ timeout: 5_000 })
})
}
)