mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
## Summary Updates tests to auto wait for vue-nodes when loading a workflow in a test with the vue-nodes tag ## Changes - **What**: - If tag includes vue-nodes, wait - Remove all load->wait calls ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11238-test-Auto-wait-for-nodes-after-loadWorkflow-in-vue-node-tests-3426d73d3650810e8760c5601186fde8) by [Unito](https://www.unito.io)
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
|
|
test.describe(
|
|
'Save Image and WEBM preview',
|
|
{ tag: ['@screenshot', '@widget', '@vue-nodes'] },
|
|
() => {
|
|
test('Can preview both SaveImage and SaveWEBM outputs', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.workflow.loadWorkflow(
|
|
'widgets/save_image_and_animated_webp'
|
|
)
|
|
|
|
await comfyPage.runButton.click()
|
|
|
|
const saveImageNode = comfyPage.vueNodes.getNodeByTitle('Save Image')
|
|
const saveWebmNode = comfyPage.vueNodes.getNodeByTitle('SaveWEBM')
|
|
|
|
// Wait for SaveImage to render an img inside .image-preview
|
|
await expect(saveImageNode.locator('.image-preview img')).toBeVisible({
|
|
timeout: 30000
|
|
})
|
|
|
|
// Wait for SaveWEBM to render a video inside .video-preview
|
|
await expect(saveWebmNode.locator('.video-preview video')).toBeVisible({
|
|
timeout: 30000
|
|
})
|
|
|
|
await expect(comfyPage.page).toHaveScreenshot(
|
|
'save-image-and-webm-preview.png'
|
|
)
|
|
})
|
|
}
|
|
)
|