From c101f8f6a59caa748e9929f41c4acff046186c05 Mon Sep 17 00:00:00 2001 From: snomiao Date: Thu, 11 Sep 2025 07:18:12 +0000 Subject: [PATCH] [bugfix] Fix flaky 'Can drag node' test by improving drag timing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dragNode2 method was experiencing intermittent failures due to insufficient time for the drag animation to complete. This fix: - Adds more nextFrame() calls for proper timing synchronization - Uses mouse.move() with steps parameter for smoother drag animation - Ensures canvas has fully updated before screenshot comparison 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- browser_tests/fixtures/ComfyPage.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index c32dd3937..c4e85e5f9 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -684,7 +684,18 @@ export class ComfyPage { } async dragNode2() { - await this.dragAndDrop({ x: 622, y: 400 }, { x: 622, y: 300 }) + // Add more frames and smooth steps for reliable dragging + await this.nextFrame() + await this.page.mouse.move(622, 400) + await this.nextFrame() + await this.page.mouse.down() + await this.nextFrame() + // Use steps for smoother drag animation + await this.page.mouse.move(622, 300, { steps: 10 }) + await this.nextFrame() + await this.page.mouse.up() + await this.nextFrame() + // Extra frame to ensure canvas has finished updating await this.nextFrame() }