Skip to content

Commit

Permalink
Add serach playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Sep 1, 2024
1 parent ef00ed5 commit d8b1782
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions browser_tests/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class NodeLibrarySidebarTab {
)
}

get nodeLibrarySearchBoxInput() {
return this.page.locator('.node-lib-search-box input[type="text"]')
}

get nodeLibraryTree() {
return this.page.locator('.node-lib-tree-explorer')
}
Expand Down
14 changes: 14 additions & 0 deletions browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ test.describe('Menu', () => {
await comfyPage.getSetting('Comfy.NodeLibrary.BookmarksCustomization')
).toEqual({})
})

test('Can filter nodes in both trees', async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.NodeLibrary.Bookmarks', [
'foo/',
'foo/KSampler (Advanced)',
'KSampler'
])

const tab = comfyPage.menu.nodeLibraryTab
await tab.nodeLibrarySearchBoxInput.fill('KSampler')
// Node search box is debounced and may take some time to update.
await comfyPage.page.waitForTimeout(1000)
expect(await tab.getNode('KSampler (Advanced)').count()).toBe(2)
})
})

test('Can change canvas zoom speed setting', async ({ comfyPage }) => {
Expand Down

0 comments on commit d8b1782

Please sign in to comment.