From 41e43bf2374e81ebddbe273f06324c6dd0963483 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 31 Jan 2026 21:47:01 -0800 Subject: [PATCH] fix(e2e): wait for V2 persistence debounce before reload in workflow modify test Amp-Thread-ID: https://ampcode.com/threads/T-019c17aa-1890-762e-ab68-28cc797456b4 --- browser_tests/tests/interaction.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/browser_tests/tests/interaction.spec.ts b/browser_tests/tests/interaction.spec.ts index eec7d64dc..14c082707 100644 --- a/browser_tests/tests/interaction.spec.ts +++ b/browser_tests/tests/interaction.spec.ts @@ -702,6 +702,24 @@ test.describe('Load workflow', { tag: '@screenshot' }, () => { await expect(comfyPage.canvas).toHaveScreenshot( 'single_ksampler_modified.png' ) + // Wait for V2 persistence to save the modified workflow (debounced at 512ms) + // Check that localStorage has a draft key with the collapsed node state + await comfyPage.page.waitForFunction( + () => { + for (let i = 0; i < window.localStorage.length; i++) { + const key = window.localStorage.key(i) + if (key?.startsWith('Comfy.Draft:')) { + const value = window.localStorage.getItem(key) + // Check that the draft contains collapsed node flags + if (value && value.includes('"flags":')) { + return true + } + } + } + return false + }, + { timeout: 2000 } + ) await comfyPage.setup({ clearStorage: false }) await expect(comfyPage.canvas).toHaveScreenshot( 'single_ksampler_modified.png'