diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 98ddf01e8..bd6198251 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -514,6 +514,10 @@ export class ComfyPage { return { x: 427, y: 98 } } + get promptDialogInput() { + return this.page.locator('.p-dialog-content input[type="text"]') + } + async disconnectEdge() { await this.dragAndDrop(this.clipTextEncodeNode1InputSlot, this.emptySpace) } @@ -778,14 +782,15 @@ export class ComfyPage { } async convertAllNodesToGroupNode(groupNodeName: string) { - this.page.on('dialog', async (dialog) => { - await dialog.accept(groupNodeName) - }) await this.canvas.press('Control+a') const node = await this.getFirstNodeRef() await node!.clickContextMenuOption('Convert to Group Node') + await this.promptDialogInput.fill(groupNodeName) + await this.page.keyboard.press('Enter') + await this.promptDialogInput.waitFor({ state: 'hidden' }) await this.nextFrame() } + async convertOffsetToCanvas(pos: [number, number]) { return this.page.evaluate((pos) => { return window['app'].canvas.ds.convertOffsetToCanvas(pos) diff --git a/browser_tests/fixtures/utils/litegraphUtils.ts b/browser_tests/fixtures/utils/litegraphUtils.ts index f065c4abc..8736c5440 100644 --- a/browser_tests/fixtures/utils/litegraphUtils.ts +++ b/browser_tests/fixtures/utils/litegraphUtils.ts @@ -233,10 +233,10 @@ export class NodeReference { await ctx.getByText(optionText).click() } async convertToGroupNode(groupNodeName: string = 'GroupNode') { - this.comfyPage.page.once('dialog', async (dialog) => { - await dialog.accept(groupNodeName) - }) await this.clickContextMenuOption('Convert to Group Node') + await this.comfyPage.promptDialogInput.fill(groupNodeName) + await this.comfyPage.page.keyboard.press('Enter') + await this.comfyPage.promptDialogInput.waitFor({ state: 'hidden' }) await this.comfyPage.nextFrame() const nodes = await this.comfyPage.getNodeRefsByType( `workflow>${groupNodeName}` diff --git a/browser_tests/rightClickMenu.spec.ts b/browser_tests/rightClickMenu.spec.ts index 901bd6bf2..a7a28b21f 100644 --- a/browser_tests/rightClickMenu.spec.ts +++ b/browser_tests/rightClickMenu.spec.ts @@ -32,11 +32,11 @@ test.describe('Canvas Right Click Menu', () => { test('Can convert to group node', async ({ comfyPage }) => { await comfyPage.select2Nodes() await expect(comfyPage.canvas).toHaveScreenshot('selected-2-nodes.png') - comfyPage.page.on('dialog', async (dialog) => { - await dialog.accept('GroupNode2CLIP') - }) await comfyPage.rightClickCanvas() await comfyPage.clickContextMenuItem('Convert to Group Node') + await comfyPage.promptDialogInput.fill('GroupNode2CLIP') + await comfyPage.page.keyboard.press('Enter') + await comfyPage.promptDialogInput.waitFor({ state: 'hidden' }) await comfyPage.nextFrame() await expect(comfyPage.canvas).toHaveScreenshot( 'right-click-node-group-node.png'