Files
ComfyUI_frontend/browser_tests/tests/execution/dynamicComboPreview.spec.ts
Glary-Bot 7cdab5a212 fix: use runButton.click() instead of executeCommand for user action
Address review feedback from @christian-byrne: use user-action
pattern (clicking the run button) instead of invoking commands
directly.
2026-04-19 23:33:48 +00:00

53 lines
1.5 KiB
TypeScript

import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
test.describe(
'DynamicCombo text preview',
{ tag: ['@workflow', '@subgraph'] },
() => {
test('shows text preview when DynamicCombo node is at top level', async ({
comfyPage
}) => {
await comfyPage.workflow.loadWorkflow('execution/dynamic_combo_preview')
const previewNode = await comfyPage.nodeOps.getNodeRefById('2')
await comfyPage.runButton.click()
await expect
.poll(async () => (await previewNode.getWidget(0)).getValue(), {
timeout: 15_000
})
.toContain('DynamicCombo output')
})
test('shows text preview when DynamicCombo node is inside subgraph', async ({
comfyPage
}) => {
await comfyPage.workflow.loadWorkflow('execution/dynamic_combo_preview')
const sourceNode = await comfyPage.nodeOps.getNodeRefById('1')
await comfyPage.canvas.click()
await comfyPage.page.keyboard.press('Control+a')
const subgraphNode = await sourceNode.convertToSubgraph()
await comfyPage.runButton.click()
await subgraphNode.navigateIntoSubgraph()
const previewNodes = await comfyPage.nodeOps.getNodeRefsByType(
'PreviewAny',
true
)
expect(previewNodes).toHaveLength(1)
await expect
.poll(async () => (await previewNodes[0].getWidget(0)).getValue(), {
timeout: 15_000
})
.toContain('DynamicCombo output')
})
}
)