mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 17:52:16 +00:00
## Summary Added browser test to verify Vue nodes display error state when workflow contains missing/unknown nodes, complementing - https://github.com/Comfy-Org/ComfyUI_frontend/pull/5758 ## Changes - **What**: Added [Playwright test](https://playwright.dev/docs/writing-tests) for Vue nodes error state handling with missing nodes - **Test Coverage**: Validates `border-error` class application on nodes with `UNKNOWN NODE` text ## Review Focus Test reliability when loading workflows with missing nodes and dialog interaction timing. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5768-test-add-browser-test-for-missing-vue-nodes-error-state-2796d73d365081aea187cdbc7920a643) by [Unito](https://www.unito.io)
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../fixtures/ComfyPage'
|
|
|
|
const BYPASS_HOTKEY = 'Control+b'
|
|
const BYPASS_CLASS = /before:bg-bypass\/60/
|
|
|
|
test.describe('Vue Node Bypass', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should allow toggling bypass on a selected node with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
const checkpointNode = comfyPage.page.locator('[data-node-id]').filter({
|
|
hasText: 'Load Checkpoint'
|
|
})
|
|
await checkpointNode.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
})
|
|
|
|
test('should allow toggling bypass on multiple selected nodes with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
const checkpointNode = comfyPage.page.locator('[data-node-id]').filter({
|
|
hasText: 'Load Checkpoint'
|
|
})
|
|
const ksamplerNode = comfyPage.page.locator('[data-node-id]').filter({
|
|
hasText: 'KSampler'
|
|
})
|
|
|
|
await checkpointNode.getByText('Load Checkpoint').click()
|
|
await ksamplerNode.getByText('KSampler').click({ modifiers: ['Control'] })
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).toHaveClass(BYPASS_CLASS)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).not.toHaveClass(BYPASS_CLASS)
|
|
})
|
|
})
|