From a56f2d38833bd47cef21cf1fb42f98b91393f57b Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Sat, 7 Feb 2026 22:35:14 -0800 Subject: [PATCH] fix: stabilize flaky workflows save-as browser assertions (#8735) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Stabilize flaky workflows sidebar browser tests by waiting for eventual UI state after `Save As`/overwrite operations. ## Changes - **What**: Replace immediate assertions with retrying `expect.poll(...)` in `browser_tests/tests/sidebar/workflows.spec.ts` for: - `Can save workflow as` - `Can overwrite other workflows with save as` ## Review Focus Verify the polling assertions are scoped to the intended eventual UI state and do not hide real regressions. ## Screenshots (if applicable) N/A ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8735-fix-stabilize-flaky-workflows-save-as-browser-assertions-3016d73d3650814abad1d767c0910ef6) by [Unito](https://www.unito.io) --- browser_tests/tests/sidebar/workflows.spec.ts | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/browser_tests/tests/sidebar/workflows.spec.ts b/browser_tests/tests/sidebar/workflows.spec.ts index 7ff026e53..572c58f7d 100644 --- a/browser_tests/tests/sidebar/workflows.spec.ts +++ b/browser_tests/tests/sidebar/workflows.spec.ts @@ -123,17 +123,14 @@ test.describe('Workflows sidebar', () => { test('Can save workflow as', async ({ comfyPage }) => { await comfyPage.command.executeCommand('Comfy.NewBlankWorkflow') await comfyPage.menu.topbar.saveWorkflowAs('workflow3.json') - expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ - '*Unsaved Workflow.json', - 'workflow3.json' - ]) + await expect + .poll(() => comfyPage.menu.workflowsTab.getOpenedWorkflowNames()) + .toEqual(['*Unsaved Workflow.json', 'workflow3.json']) await comfyPage.menu.topbar.saveWorkflowAs('workflow4.json') - expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ - '*Unsaved Workflow.json', - 'workflow3.json', - 'workflow4.json' - ]) + await expect + .poll(() => comfyPage.menu.workflowsTab.getOpenedWorkflowNames()) + .toEqual(['*Unsaved Workflow.json', 'workflow3.json', 'workflow4.json']) }) test('Exported workflow does not contain localized slot names', async ({ @@ -220,24 +217,22 @@ test.describe('Workflows sidebar', () => { await topbar.saveWorkflow('workflow1.json') await topbar.saveWorkflowAs('workflow2.json') await comfyPage.nextFrame() - expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ - 'workflow1.json', - 'workflow2.json' - ]) - expect(await comfyPage.menu.workflowsTab.getActiveWorkflowName()).toEqual( - 'workflow2.json' - ) + await expect + .poll(() => comfyPage.menu.workflowsTab.getOpenedWorkflowNames()) + .toEqual(['workflow1.json', 'workflow2.json']) + await expect + .poll(() => comfyPage.menu.workflowsTab.getActiveWorkflowName()) + .toEqual('workflow2.json') await topbar.saveWorkflowAs('workflow1.json') await comfyPage.confirmDialog.click('overwrite') // The old workflow1.json should be deleted and the new one should be saved. - expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ - 'workflow2.json', - 'workflow1.json' - ]) - expect(await comfyPage.menu.workflowsTab.getActiveWorkflowName()).toEqual( - 'workflow1.json' - ) + await expect + .poll(() => comfyPage.menu.workflowsTab.getOpenedWorkflowNames()) + .toEqual(['workflow2.json', 'workflow1.json']) + await expect + .poll(() => comfyPage.menu.workflowsTab.getActiveWorkflowName()) + .toEqual('workflow1.json') }) test('Does not report warning when switching between opened workflows', async ({