Add test to guard against break in undo / redo

This commit is contained in:
filtered
2024-11-09 14:12:54 +11:00
parent f8ec87ddea
commit 272d320551
2 changed files with 33 additions and 0 deletions

View File

@@ -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
}) => {

View File

@@ -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 {