[bugfix] Fix flaky 'Can drag node' test by improving drag timing

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 <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-09-11 07:18:12 +00:00
parent 6ea021d595
commit c101f8f6a5

View File

@@ -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()
}