From 01f59afff2bcd221e6453b6c374fed7345b520a5 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Fri, 20 Feb 2026 02:37:32 -0800 Subject: [PATCH] test: fix flaky 'Can drag node' screenshot test (#8967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fix intermittently failing 'Can drag node' screenshot test that blocks CI on main and all PR branches. ## Changes - **What**: Add `nextFrame()` waits after switching `Comfy.UseNewMenu` from `Top` to `Disabled` in the `beforeEach` hook. The setting change removes the top bar, causing the canvas to resize. Without waiting, the hardcoded drag coordinates can miss the node entirely (resulting in a canvas pan instead of a node drag). ## Review Focus The root cause: `setSetting('Comfy.UseNewMenu', 'Disabled')` triggers a layout shift (top bar disappears → canvas grows vertically). Litegraph needs 1-2 frames to process the canvas resize. The drag starts at hardcoded screen coords `{622, 400}` which only map to the node after the resize settles. --- browser_tests/tests/interaction.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser_tests/tests/interaction.spec.ts b/browser_tests/tests/interaction.spec.ts index 87c3e8a0bf..f3ac5678b9 100644 --- a/browser_tests/tests/interaction.spec.ts +++ b/browser_tests/tests/interaction.spec.ts @@ -13,6 +13,9 @@ import type { NodeReference } from '../fixtures/utils/litegraphUtils' test.beforeEach(async ({ comfyPage }) => { await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled') + // Wait for the legacy menu to appear and canvas to settle after layout shift. + await comfyPage.page.locator('.comfy-menu').waitFor({ state: 'visible' }) + await comfyPage.nextFrame() }) test.describe('Item Interaction', { tag: ['@screenshot', '@node'] }, () => {