From 5b730517a37b005537c6cddfedbf810d87f27973 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 20 Mar 2025 20:42:12 -0400 Subject: [PATCH] [Test] Sync workflow instead of full page reload (#3168) --- browser_tests/fixtures/ComfyPage.ts | 4 ++++ browser_tests/tests/sidebar/workflows.spec.ts | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index ed1409425..70ab7da1f 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -214,6 +214,10 @@ export class ComfyPage { `Failed to setup workflows directory: ${await resp.text()}` ) } + + await this.page.evaluate(async () => { + await window['app'].extensionManager.workflow.syncWorkflows() + }) } async setupUser(username: string) { diff --git a/browser_tests/tests/sidebar/workflows.spec.ts b/browser_tests/tests/sidebar/workflows.spec.ts index 0ddcf8dd8..b5f3411a4 100644 --- a/browser_tests/tests/sidebar/workflows.spec.ts +++ b/browser_tests/tests/sidebar/workflows.spec.ts @@ -34,7 +34,6 @@ test.describe('Workflows sidebar', () => { 'workflow1.json': 'default.json', 'workflow2.json': 'default.json' }) - await comfyPage.setup() const tab = comfyPage.menu.workflowsTab await tab.open() @@ -77,7 +76,6 @@ test.describe('Workflows sidebar', () => { await comfyPage.setupWorkflowsDirectory({ 'workflow1.json': 'single_ksampler.json' }) - await comfyPage.setup() const tab = comfyPage.menu.workflowsTab await tab.open() @@ -101,7 +99,6 @@ test.describe('Workflows sidebar', () => { 'bar.json': 'default.json' } }) - await comfyPage.setup() const tab = comfyPage.menu.workflowsTab await tab.open() @@ -323,7 +320,7 @@ test.describe('Workflows sidebar', () => { await comfyPage.setupWorkflowsDirectory({ 'workflow1.json': 'default.json' }) - await comfyPage.setup() + await comfyPage.menu.workflowsTab.open() const nodeCount = await comfyPage.getGraphNodesCount()