test: fix flaky 'Can drag node' screenshot test (#8967)

## 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.
This commit is contained in:
Christian Byrne
2026-02-20 02:37:32 -08:00
committed by GitHub
parent f4ca285d07
commit 01f59afff2

View File

@@ -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'] }, () => {