mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
test: fix draft reload in subgraph position E2E test
Use page.reload() with explicit draft persistence polling instead of comfyPage.setup(), which triggered a full navigation that bypassed the draft auto-load flow.
This commit is contained in:
@@ -11,6 +11,9 @@ test.describe(
|
||||
}) => {
|
||||
test.setTimeout(30000)
|
||||
|
||||
// Enable workflow persistence explicitly
|
||||
await comfyPage.settings.setSetting('Comfy.Workflow.Persist', true)
|
||||
|
||||
// Load a workflow containing a subgraph
|
||||
await comfyPage.workflow.loadWorkflow('subgraphs/basic-subgraph')
|
||||
|
||||
@@ -29,8 +32,28 @@ test.describe(
|
||||
|
||||
expect(positionsBefore.length).toBeGreaterThan(0)
|
||||
|
||||
// Reload the page keeping localStorage (draft auto-loads)
|
||||
await comfyPage.setup({ clearStorage: false })
|
||||
// Wait for the debounced draft persistence to flush to localStorage
|
||||
await expect
|
||||
.poll(
|
||||
() =>
|
||||
comfyPage.page.evaluate(() =>
|
||||
Object.keys(localStorage).some((k) =>
|
||||
k.startsWith('Comfy.Workflow.Draft.v2:')
|
||||
)
|
||||
),
|
||||
{ timeout: 3000 }
|
||||
)
|
||||
.toBe(true)
|
||||
|
||||
// Reload the page (draft auto-loads with hash preserved)
|
||||
await comfyPage.page.reload({ waitUntil: 'networkidle' })
|
||||
await comfyPage.page.waitForFunction(
|
||||
() => window.app && window.app.extensionManager
|
||||
)
|
||||
await comfyPage.page.waitForSelector('.p-blockui-mask', {
|
||||
state: 'hidden'
|
||||
})
|
||||
await comfyPage.nextFrame()
|
||||
|
||||
// Wait for subgraph auto-entry via hash navigation
|
||||
await expect
|
||||
|
||||
Reference in New Issue
Block a user