From a0c06bd723de4cbf7345ecf38ad9ed1d59582a4f Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Thu, 25 Sep 2025 11:16:19 -0700 Subject: [PATCH] [test] add browser test for missing vue nodes error state (#5768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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) --- .../tests/vueNodes/nodeStates/bypass.spec.ts | 4 --- .../tests/vueNodes/nodeStates/error.spec.ts | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 browser_tests/tests/vueNodes/nodeStates/error.spec.ts diff --git a/browser_tests/tests/vueNodes/nodeStates/bypass.spec.ts b/browser_tests/tests/vueNodes/nodeStates/bypass.spec.ts index 9f9791663..c80a86503 100644 --- a/browser_tests/tests/vueNodes/nodeStates/bypass.spec.ts +++ b/browser_tests/tests/vueNodes/nodeStates/bypass.spec.ts @@ -3,10 +3,6 @@ import { comfyPageFixture as test } from '../../../fixtures/ComfyPage' -test.beforeEach(async ({ comfyPage }) => { - await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled') -}) - const BYPASS_HOTKEY = 'Control+b' const BYPASS_CLASS = /before:bg-bypass\/60/ diff --git a/browser_tests/tests/vueNodes/nodeStates/error.spec.ts b/browser_tests/tests/vueNodes/nodeStates/error.spec.ts new file mode 100644 index 000000000..f4f8e10fe --- /dev/null +++ b/browser_tests/tests/vueNodes/nodeStates/error.spec.ts @@ -0,0 +1,32 @@ +import { + comfyExpect as expect, + comfyPageFixture as test +} from '../../../fixtures/ComfyPage' + +const ERROR_CLASS = /border-error/ + +test.describe('Vue Node Error', () => { + test.beforeEach(async ({ comfyPage }) => { + await comfyPage.setSetting('Comfy.VueNodes.Enabled', true) + await comfyPage.vueNodes.waitForNodes() + }) + + test('should display error state when node is missing (node from workflow is not installed)', async ({ + comfyPage + }) => { + await comfyPage.setup() + await comfyPage.loadWorkflow('missing/missing_nodes') + + // Close missing nodes warning dialog + await comfyPage.page.getByRole('button', { name: 'Close' }).click() + await comfyPage.page.waitForSelector('.comfy-missing-nodes', { + state: 'hidden' + }) + + // Expect error state on missing unknown node + const unknownNode = comfyPage.page.locator('[data-node-id]').filter({ + hasText: 'UNKNOWN NODE' + }) + await expect(unknownNode).toHaveClass(ERROR_CLASS) + }) +})