Compare commits

...

4 Commits

Author SHA1 Message Date
filtered
f6003f1dcc Fix missed awaits 2024-11-09 14:56:29 +11:00
filtered
ab0ddc09a2 Add human-factor to undo test 2024-11-09 14:35:09 +11:00
filtered
da3702352c Fix undo-redo expectations 2024-11-09 14:35:09 +11:00
filtered
272d320551 Add test to guard against break in undo / redo 2024-11-09 14:35:08 +11:00
2 changed files with 42 additions and 0 deletions

View File

@@ -53,6 +53,38 @@ test.describe('Change Tracker', () => {
})
})
test('Can undo & redo user changes', async ({ comfyPage }) => {
await comfyPage.clickEmptySpace()
await expect(comfyPage.canvas).toHaveScreenshot('undo-initial-state.png')
await comfyPage.dragAndDrop(
comfyPage.clipTextEncodeNode2OutputSlot,
comfyPage.kSamplerTitlebar
)
await expect(comfyPage.canvas).toHaveScreenshot('undo-step1.png')
await comfyPage.ctrlZ()
await expect(comfyPage.canvas).toHaveScreenshot('undo-initial-state.png')
await comfyPage.dragAndDrop(
comfyPage.clipTextEncodeNode1OutputSlot,
comfyPage.kSamplerTitlebar
)
await expect(comfyPage.canvas).toHaveScreenshot('undo-step3.png')
// Test what a real person does
await comfyPage.ctrlZ()
await comfyPage.ctrlZ()
await comfyPage.ctrlZ()
await comfyPage.ctrlZ()
await expect(comfyPage.canvas).toHaveScreenshot('undo-initial-state.png')
// Test past the bounds of the buffer
await comfyPage.ctrlY()
await comfyPage.ctrlY()
await expect(comfyPage.canvas).toHaveScreenshot('undo-step3.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 {