diff --git a/browser_tests/changeTracker.spec.ts b/browser_tests/changeTracker.spec.ts index c2bf290bb9..995e2cea5d 100644 --- a/browser_tests/changeTracker.spec.ts +++ b/browser_tests/changeTracker.spec.ts @@ -53,6 +53,29 @@ test.describe('Change Tracker', () => { }) }) + test('Can undo & redo user changes', async ({ comfyPage }) => { + comfyPage.clickEmptySpace() + await expect(comfyPage.canvas).toHaveScreenshot('undo-initial-state.png') + + comfyPage.dragAndDrop( + comfyPage.clipTextEncodeNode2OutputSlot, + comfyPage.kSamplerTitlebar + ) + await expect(comfyPage.canvas).toHaveScreenshot('undo-step1.png') + + comfyPage.ctrlZ() + await expect(comfyPage.canvas).toHaveScreenshot('undo-step2.png') + + comfyPage.dragAndDrop( + comfyPage.clipTextEncodeNode1OutputSlot, + comfyPage.kSamplerTitlebar + ) + await expect(comfyPage.canvas).toHaveScreenshot('undo-step3.png') + + comfyPage.ctrlZ() + await expect(comfyPage.canvas).toHaveScreenshot('undo-step4.png') + }) + test('Can group multiple change actions into a single transaction', async ({ comfyPage }) => { diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 65950f4dce..53518cb288 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -458,10 +458,20 @@ export class ComfyPage { get clipTextEncodeNode1InputSlot(): Position { return { x: 427, y: 198 } } + get clipTextEncodeNode1OutputSlot(): Position { + return { x: 828, y: 197 } + } get clipTextEncodeNode2InputSlot(): Position { return { x: 422, y: 402 } } + get clipTextEncodeNode2OutputSlot(): Position { + return { x: 828, y: 400 } + } + + get kSamplerTitlebar(): Position { + return { x: 1058, y: 175 } + } // A point on input edge. get clipTextEncodeNode2InputLinkPath(): Position {