Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -828,55 +828,55 @@ test.describe('Vue Node Link Interaction', () => {
})

test.describe('Release actions (Shift-drop)', () => {
test.fixme(
'Context menu opens and endpoint is pinned on Shift-drop',
async ({ comfyPage, comfyMouse }) => {
await comfyPage.setSetting(
'Comfy.LinkRelease.ActionShift',
'context menu'
)

const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
expect(samplerNode).toBeTruthy()

const outputCenter = await getSlotCenter(
comfyPage.page,
samplerNode.id,
0,
false
)

const dropPos = { x: outputCenter.x + 180, y: outputCenter.y - 140 }

await comfyMouse.move(outputCenter)
await comfyPage.page.keyboard.down('Shift')
try {
await comfyMouse.drag(dropPos)
await comfyMouse.drop()
} finally {
await comfyPage.page.keyboard.up('Shift').catch(() => {})
}
test('Context menu opens and endpoint is pinned on Shift-drop', async ({
comfyPage,
comfyMouse
}) => {
await comfyPage.setSetting(
'Comfy.LinkRelease.ActionShift',
'context menu'
)

// Context menu should be visible
const contextMenu = comfyPage.page.locator('.litecontextmenu')
await expect(contextMenu).toBeVisible()

// Pinned endpoint should not change with mouse movement while menu is open
const before = await comfyPage.page.evaluate(() => {
const snap = window['app']?.canvas?.linkConnector?.state?.snapLinksPos
return Array.isArray(snap) ? [snap[0], snap[1]] : null
})
expect(before).not.toBeNull()

// Move mouse elsewhere and verify snap position is unchanged
await comfyMouse.move({ x: dropPos.x + 160, y: dropPos.y + 100 })
const after = await comfyPage.page.evaluate(() => {
const snap = window['app']?.canvas?.linkConnector?.state?.snapLinksPos
return Array.isArray(snap) ? [snap[0], snap[1]] : null
})
expect(after).toEqual(before)
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
expect(samplerNode).toBeTruthy()

const outputCenter = await getSlotCenter(
comfyPage.page,
samplerNode.id,
0,
false
)

const dropPos = { x: outputCenter.x + 90, y: outputCenter.y - 70 }

await comfyMouse.move(outputCenter)
await comfyPage.page.keyboard.down('Shift')
try {
await comfyMouse.drag(dropPos)
await comfyMouse.drop()
} finally {
await comfyPage.page.keyboard.up('Shift').catch(() => {})
}
)

// Context menu should be visible
const contextMenu = comfyPage.page.locator('.litecontextmenu')
await expect(contextMenu).toBeVisible()
Comment on lines +861 to +863
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -nP -A5 -B5 '\.litecontextmenu' browser_tests/tests/vueNodes/

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1374


🏁 Script executed:

cat -n browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts | sed -n '840,900p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 2606


🏁 Script executed:

cat -n browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts | sed -n '1,50p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1969


🏁 Script executed:

grep -n "beforeEach\|afterEach\|beforeAll\|afterAll" browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 118


🏁 Script executed:

find browser_tests/fixtures -name "*ComfyPage*" -type f

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 105


🏁 Script executed:

cat -n browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts | sed -n '100,115p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 776


🏁 Script executed:

wc -l browser_tests/fixtures/ComfyPage.ts && head -100 browser_tests/fixtures/ComfyPage.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 3152


🏁 Script executed:

rg -n "litecontextmenu\|contextmenu" browser_tests/fixtures/ -A3 -B3

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

rg -n "keyboard.*Escape\|Escape.*key" browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

grep -n "escapeMenu\|closeMenu\|dismissMenu" browser_tests/fixtures/ComfyPage.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 96


🏁 Script executed:

cat -n browser_tests/fixtures/ComfyPage.ts | sed -n '1410,1425p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 582


🏁 Script executed:

rg -n "closeMenu\(\)" browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

rg -n "\.litecontextmenu\|page.keyboard.press.*Escape" browser_tests/tests/ -A2

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

rg -n "test\('" browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1502


🏁 Script executed:

cat -n browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts | sed -n '873,890p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 842


🏁 Script executed:

grep -n "page.keyboard.press\|keyboard.down.*Escape\|click.*away" browser_tests/tests/vueNodes/interactions/links/*.spec.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

cat browser_tests/playwright.config.ts | grep -A10 -B10 "fullyParallel\|testDir\|beforeEach\|teardown"

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 136


🏁 Script executed:

find browser_tests -name "*.ts" -path "*fixtures*" -exec grep -l "beforeEach\|afterEach" {} \; | head -5

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

find . -name "playwright.config.*" -o -name "vitest.config.*" 2>/dev/null | head -5

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 111


🏁 Script executed:

cat -n browser_tests/fixtures/ComfyPage.ts | sed -n '1,30p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1553


🏁 Script executed:

grep -n "use\|fullyParallel\|testDir\|beforeEach\|afterEach\|cleanupTest" playwright.config.ts | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 894


Add explicit context menu dismissal to improve test cleanup.

The context menu is opened (line 862) but not explicitly closed before the test ends. While Playwright's page isolation between tests mitigates interference, explicitly dismissing the menu with await comfyPage.page.keyboard.press('Escape') or clicking elsewhere improves test clarity and resilience. Consider adding cleanup after the assertions on line 863.

🤖 Prompt for AI Agents
In browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts
around lines 861 to 863, the test asserts the context menu is visible but does
not close it; add an explicit dismissal after the assertion by sending Escape
(await comfyPage.page.keyboard.press('Escape')) or clicking outside (await
comfyPage.page.click('body', { position: { x: 0, y: 0 } })) to reliably close
the .litecontextmenu before the test ends and improve cleanup.


// Pinned endpoint should not change with mouse movement while menu is open
const before = await comfyPage.page.evaluate(() => {
const snap = window['app']?.canvas?.linkConnector?.state?.snapLinksPos
return Array.isArray(snap) ? [snap[0], snap[1]] : null
})
expect(before).not.toBeNull()

// Move mouse elsewhere and verify snap position is unchanged
await comfyMouse.move({ x: dropPos.x + 160, y: dropPos.y + 100 })
const after = await comfyPage.page.evaluate(() => {
const snap = window['app']?.canvas?.linkConnector?.state?.snapLinksPos
return Array.isArray(snap) ? [snap[0], snap[1]] : null
})
expect(after).toEqual(before)
})

test('Context menu -> Search pre-filters by link type and connects after selection', async ({
comfyPage,
Expand Down