Restore context menu for new searchbox (#724)

* Searchbox revamp

* nit

* nit

* Add playwright test

* Update litegraph

* Rename setting

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-03 13:28:26 -04:00
committed by GitHub
parent 974a7ef63f
commit 36cdebcad1
13 changed files with 177 additions and 94 deletions

View File

@@ -3,22 +3,14 @@ import { comfyPageFixture as test } from './ComfyPage'
test.describe('Node search box', () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.setSetting(
'Comfy.NodeSearchBoxImpl.LinkReleaseTrigger',
'always'
)
await comfyPage.setSetting('Comfy.LinkRelease.Action', 'search box')
await comfyPage.setSetting('Comfy.LinkRelease.ActionShift', 'search box')
await comfyPage.setSetting('Comfy.NodeSearchBoxImpl', 'default')
})
;['always', 'hold shift', 'NOT hold shift'].forEach((triggerMode) => {
test(`Can trigger on empty canvas double click (${triggerMode})`, async ({
comfyPage
}) => {
await comfyPage.setSetting(
'Comfy.NodeSearchBoxImpl.LinkReleaseTrigger',
triggerMode
)
await comfyPage.doubleClickCanvas()
await expect(comfyPage.searchBox.input).toHaveCount(1)
})
test(`Can trigger on empty canvas double click`, async ({ comfyPage }) => {
await comfyPage.doubleClickCanvas()
await expect(comfyPage.searchBox.input).toHaveCount(1)
})
test('Can trigger on link release', async ({ comfyPage }) => {
@@ -78,3 +70,18 @@ test.describe('Node search box', () => {
)
})
})
test.describe('Release context menu', () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.LinkRelease.Action', 'context menu')
await comfyPage.setSetting('Comfy.LinkRelease.ActionShift', 'search box')
await comfyPage.setSetting('Comfy.NodeSearchBoxImpl', 'default')
})
test('Can trigger on link release', async ({ comfyPage }) => {
await comfyPage.disconnectEdge()
await expect(comfyPage.canvas).toHaveScreenshot(
'link-release-context-menu.png'
)
})
})