Pin reroute on link release searchbox (#469)

* Correctly handle wildcard type

* Add test

* nit

* Pin reroute on link release search

* Connect wildcard

* nit
This commit is contained in:
Chenlei Hu
2024-08-16 13:22:17 -04:00
committed by GitHub
parent d1715972e3
commit 9cea54686a
7 changed files with 43 additions and 12 deletions

View File

@@ -26,14 +26,20 @@ class ComfyNodeSearchBox {
)
}
async fillAndSelectFirstNode(nodeName: string) {
async fillAndSelectFirstNode(
nodeName: string,
options?: { suggestionIndex: number }
) {
await this.input.waitFor({ state: 'visible' })
await this.input.fill(nodeName)
await this.dropdown.waitFor({ state: 'visible' })
// Wait for some time for the auto complete list to update.
// The auto complete list is debounced and may take some time to update.
await this.page.waitForTimeout(500)
await this.dropdown.locator('li').nth(0).click()
await this.dropdown
.locator('li')
.nth(options?.suggestionIndex || 0)
.click()
}
}

View File

@@ -35,7 +35,10 @@ test.describe('Node search box', () => {
test('Can auto link node', async ({ comfyPage }) => {
await comfyPage.disconnectEdge()
await comfyPage.searchBox.fillAndSelectFirstNode('CLIPTextEncode')
// Select the second item as the first item is always reroute
await comfyPage.searchBox.fillAndSelectFirstNode('CLIPTextEncode', {
suggestionIndex: 1
})
await expect(comfyPage.canvas).toHaveScreenshot('auto-linked-node.png')
})
@@ -54,7 +57,10 @@ test.describe('Node search box', () => {
await comfyPage.dragAndDrop(outputSlot1Pos, emptySpacePos)
await comfyPage.page.keyboard.up('Shift')
await comfyPage.searchBox.fillAndSelectFirstNode('Load Checkpoint')
// Select the second item as the first item is always reroute
await comfyPage.searchBox.fillAndSelectFirstNode('Load Checkpoint', {
suggestionIndex: 1
})
await expect(comfyPage.canvas).toHaveScreenshot(
'auto-linked-node-batch.png'
)