mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
test: replace hardcoded delay() calls with retrying assertions
- Remove comfyPage.delay(1000) in toggle test — the preceding toHaveScreenshot already confirms the canvas is stable - Replace comfyPage.delay(300) in two dialog-dismiss tests with toPass() blocks that retry the click+hidden assertion, handling the case where the click-outside handler isn't attached yet
This commit is contained in:
@@ -335,7 +335,6 @@ test.describe('Node Interaction', () => {
|
||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||
'text-encode-toggled-off.png'
|
||||
)
|
||||
await comfyPage.delay(1000)
|
||||
await comfyPage.canvas.click({
|
||||
position: DefaultGraphPositions.textEncodeNodeToggler
|
||||
})
|
||||
@@ -358,14 +357,10 @@ test.describe('Node Interaction', () => {
|
||||
})
|
||||
const legacyPrompt = comfyPage.page.locator('.graphdialog')
|
||||
await expect(legacyPrompt).toBeVisible()
|
||||
await comfyPage.delay(300)
|
||||
await comfyPage.canvas.click({
|
||||
position: {
|
||||
x: 10,
|
||||
y: 10
|
||||
}
|
||||
})
|
||||
await expect(legacyPrompt).toBeHidden()
|
||||
await expect(async () => {
|
||||
await comfyPage.canvas.click({ position: { x: 10, y: 10 } })
|
||||
await expect(legacyPrompt).toBeHidden()
|
||||
}).toPass({ timeout: 2_000 })
|
||||
})
|
||||
|
||||
test('Can close prompt dialog with canvas click (text widget)', async ({
|
||||
@@ -381,14 +376,10 @@ test.describe('Node Interaction', () => {
|
||||
})
|
||||
const legacyPrompt = comfyPage.page.locator('.graphdialog')
|
||||
await expect(legacyPrompt).toBeVisible()
|
||||
await comfyPage.delay(300)
|
||||
await comfyPage.canvas.click({
|
||||
position: {
|
||||
x: 10,
|
||||
y: 10
|
||||
}
|
||||
})
|
||||
await expect(legacyPrompt).toBeHidden()
|
||||
await expect(async () => {
|
||||
await comfyPage.canvas.click({ position: { x: 10, y: 10 } })
|
||||
await expect(legacyPrompt).toBeHidden()
|
||||
}).toPass({ timeout: 2_000 })
|
||||
})
|
||||
|
||||
test(
|
||||
|
||||
Reference in New Issue
Block a user