diff --git a/browser_tests/assets/single_save_image_node.json b/browser_tests/assets/single_save_image_node.json new file mode 100644 index 000000000..c917a9a84 --- /dev/null +++ b/browser_tests/assets/single_save_image_node.json @@ -0,0 +1,46 @@ +{ + "last_node_id": 9, + "last_link_id": 9, + "nodes": [ + { + "id": 9, + "type": "SaveImage", + "pos": { + "0": 64, + "1": 104 + }, + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": null + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + } + ], + "links": [], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1, + "offset": [ + 0, + 0 + ] + } + }, + "version": 0.4 +} \ No newline at end of file diff --git a/browser_tests/interaction.spec.ts b/browser_tests/interaction.spec.ts index c0b3d5ba0..99c766f1a 100644 --- a/browser_tests/interaction.spec.ts +++ b/browser_tests/interaction.spec.ts @@ -111,12 +111,15 @@ test.describe('Node Interaction', () => { ) }) - test('Can close prompt dialog with canvas click', async ({ comfyPage }) => { + test('Can close prompt dialog with canvas click (number widget)', async ({ + comfyPage + }) => { + const numberWidgetPos = { + x: 724, + y: 645 + } await comfyPage.canvas.click({ - position: { - x: 724, - y: 645 - } + position: numberWidgetPos }) await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-opened.png') // Wait for 1s so that it does not trigger the search box by double click. @@ -130,6 +133,32 @@ test.describe('Node Interaction', () => { await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-closed.png') }) + test('Can close prompt dialog with canvas click (text widget)', async ({ + comfyPage + }) => { + const textWidgetPos = { + x: 167, + y: 143 + } + await comfyPage.loadWorkflow('single_save_image_node') + await comfyPage.canvas.click({ + position: textWidgetPos + }) + await expect(comfyPage.canvas).toHaveScreenshot( + 'prompt-dialog-opened-text.png' + ) + await comfyPage.page.waitForTimeout(1000) + await comfyPage.canvas.click({ + position: { + x: 10, + y: 10 + } + }) + await expect(comfyPage.canvas).toHaveScreenshot( + 'prompt-dialog-closed-text.png' + ) + }) + test('Can double click node title to edit', async ({ comfyPage }) => { await comfyPage.loadWorkflow('single_ksampler') await comfyPage.canvas.dblclick({ diff --git a/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-closed-text-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-closed-text-chromium-linux.png new file mode 100644 index 000000000..cdccaf8c3 Binary files /dev/null and b/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-closed-text-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-opened-text-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-opened-text-chromium-linux.png new file mode 100644 index 000000000..afb188eea Binary files /dev/null and b/browser_tests/interaction.spec.ts-snapshots/prompt-dialog-opened-text-chromium-linux.png differ