fix: use dispatchEvent to bypass canvas overlay for dialog dismiss

The dialog's click-outside handler (LGraphCanvas.prompt L7175-7190)
registers via setTimeout(10ms) with a 256ms debounce. The canvas
z-999 overlay blocks normal Playwright click() and force:true
doesn't set e.target to the canvas element. dispatchEvent('click')
bypasses the overlay while correctly targeting the canvas. Custom
toPass intervals [300, 500, 1000] start past the 266ms debounce.
This commit is contained in:
Glary-Bot
2026-04-08 05:53:54 +00:00
parent 78b0ec5efb
commit c205530282

View File

@@ -358,13 +358,13 @@ test.describe('Node Interaction', () => {
})
const legacyPrompt = comfyPage.page.locator('.graphdialog')
await expect(legacyPrompt).toBeVisible()
// The dialog registers its click-outside handler via setTimeout(10ms)
// with a 256ms debounce (see LGraphCanvas.prompt). dispatchEvent
// bypasses the canvas z-999 overlay that blocks normal clicks.
await expect(async () => {
await comfyPage.canvas.click({
position: { x: 10, y: 10 },
force: true
})
await comfyPage.canvas.dispatchEvent('click', { bubbles: true })
await expect(legacyPrompt).toBeHidden()
}).toPass({ timeout: 5_000 })
}).toPass({ intervals: [300, 500, 1000], timeout: 5_000 })
})
test('Can close prompt dialog with canvas click (text widget)', async ({
@@ -381,12 +381,9 @@ test.describe('Node Interaction', () => {
const legacyPrompt = comfyPage.page.locator('.graphdialog')
await expect(legacyPrompt).toBeVisible()
await expect(async () => {
await comfyPage.canvas.click({
position: { x: 10, y: 10 },
force: true
})
await comfyPage.canvas.dispatchEvent('click', { bubbles: true })
await expect(legacyPrompt).toBeHidden()
}).toPass({ timeout: 5_000 })
}).toPass({ intervals: [300, 500, 1000], timeout: 5_000 })
})
test(