From d4a77f4b8c66f3e08f67d0d647f24eeedcfffa31 Mon Sep 17 00:00:00 2001 From: christian-byrne Date: Tue, 17 Sep 2024 01:13:56 -0700 Subject: [PATCH 1/2] Add tests on adding group node from library sidebar --- browser_tests/groupNode.spec.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/browser_tests/groupNode.spec.ts b/browser_tests/groupNode.spec.ts index 2b14f7a4..ad07f94d 100644 --- a/browser_tests/groupNode.spec.ts +++ b/browser_tests/groupNode.spec.ts @@ -2,10 +2,42 @@ import { expect } from '@playwright/test' import { comfyPageFixture as test } from './ComfyPage' test.describe('Group Node', () => { + test.afterEach(async ({ comfyPage }) => { + await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled') + }) + + test('is added to node library sidebar', async ({ comfyPage }) => { + await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') + const groupNodeName = 'DefautWorkflowGroupNode' + await comfyPage.convertAllNodesToGroupNode(groupNodeName) + const tab = comfyPage.menu.nodeLibraryTab + await tab.open() + expect(await tab.getFolder('group nodes').count()).toBe(1) + }) + + test('Can be added with node library sidebar', async ({ comfyPage }) => { + await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') + const groupNodeName = 'DefautWorkflowGroupNode' + await comfyPage.convertAllNodesToGroupNode(groupNodeName) + const initialNodeCount = await comfyPage.getGraphNodesCount() + + // Add group node from node library sidebar + const tab = comfyPage.menu.nodeLibraryTab + await tab.open() + await tab.getFolder('group nodes').click() + await tab.getFolder('workflow').click() + await tab.getFolder('workflow').last().click() + await tab.getNode(groupNodeName).click() + + // Verify the node is added to the canvas + expect(await comfyPage.getGraphNodesCount()).toBe(initialNodeCount + 1) + }) + test('Can be added with search', async ({ comfyPage }) => { const groupNodeName = 'DefautWorkflowGroupNode' await comfyPage.convertAllNodesToGroupNode(groupNodeName) await comfyPage.doubleClickCanvas() + await comfyPage.nextFrame() await comfyPage.searchBox.fillAndSelectFirstNode(groupNodeName) await expect(comfyPage.canvas).toHaveScreenshot( 'group-node-copy-added-from-search.png' From 50c6295cea7e7d0244be50053afc2fb2135c3a83 Mon Sep 17 00:00:00 2001 From: christian-byrne Date: Tue, 17 Sep 2024 01:17:05 -0700 Subject: [PATCH 2/2] Improve test name clarity --- browser_tests/groupNode.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/browser_tests/groupNode.spec.ts b/browser_tests/groupNode.spec.ts index ad07f94d..8e5d69ed 100644 --- a/browser_tests/groupNode.spec.ts +++ b/browser_tests/groupNode.spec.ts @@ -6,7 +6,7 @@ test.describe('Group Node', () => { await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled') }) - test('is added to node library sidebar', async ({ comfyPage }) => { + test('Is added to node library sidebar', async ({ comfyPage }) => { await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') const groupNodeName = 'DefautWorkflowGroupNode' await comfyPage.convertAllNodesToGroupNode(groupNodeName) @@ -15,7 +15,9 @@ test.describe('Group Node', () => { expect(await tab.getFolder('group nodes').count()).toBe(1) }) - test('Can be added with node library sidebar', async ({ comfyPage }) => { + test('Can be added to canvas using node library sidebar', async ({ + comfyPage + }) => { await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') const groupNodeName = 'DefautWorkflowGroupNode' await comfyPage.convertAllNodesToGroupNode(groupNodeName) @@ -33,7 +35,7 @@ test.describe('Group Node', () => { expect(await comfyPage.getGraphNodesCount()).toBe(initialNodeCount + 1) }) - test('Can be added with search', async ({ comfyPage }) => { + test('Can be added to canvas using search', async ({ comfyPage }) => { const groupNodeName = 'DefautWorkflowGroupNode' await comfyPage.convertAllNodesToGroupNode(groupNodeName) await comfyPage.doubleClickCanvas()