diff --git a/browser_tests/fixtures/helpers/SubgraphHelper.ts b/browser_tests/fixtures/helpers/SubgraphHelper.ts index d24511c746..e44f3b3ba6 100644 --- a/browser_tests/fixtures/helpers/SubgraphHelper.ts +++ b/browser_tests/fixtures/helpers/SubgraphHelper.ts @@ -445,13 +445,11 @@ export class SubgraphHelper { await this.comfyPage.nextFrame() } - async convertDefaultKSamplerToSubgraph(): Promise { + async loadDefaultAndConvertKSamplerToSubgraph(): Promise { await this.comfyPage.workflow.loadWorkflow('default') const ksampler = await this.comfyPage.nodeOps.getNodeRefById('3') await ksampler.click('title') - const subgraphNode = await ksampler.convertToSubgraph() - await this.comfyPage.nextFrame() - return subgraphNode + return ksampler.convertToSubgraph() } async packAllInteriorNodes(hostNodeId: string): Promise { diff --git a/browser_tests/tests/subgraph-promoted-widget-dom.spec.ts b/browser_tests/tests/subgraph-promoted-widget-dom.spec.ts index 4b027c1f69..c925eb3063 100644 --- a/browser_tests/tests/subgraph-promoted-widget-dom.spec.ts +++ b/browser_tests/tests/subgraph-promoted-widget-dom.spec.ts @@ -16,7 +16,7 @@ test.describe( comfyPage }) => { const subgraphNode = - await comfyPage.subgraph.convertDefaultKSamplerToSubgraph() + await comfyPage.subgraph.loadDefaultAndConvertKSamplerToSubgraph() // Enable Vue nodes now that the subgraph has been created await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true) diff --git a/browser_tests/tests/subgraph.spec.ts b/browser_tests/tests/subgraph.spec.ts index 669527c48c..c3414b3ffc 100644 --- a/browser_tests/tests/subgraph.spec.ts +++ b/browser_tests/tests/subgraph.spec.ts @@ -107,6 +107,7 @@ test.describe('Subgraph Operations', { tag: ['@slow', '@subgraph'] }, () => { await subgraphNode.navigateIntoSubgraph() const initialInputLabel = await comfyPage.subgraph.getSlotLabel('input') + expect(initialInputLabel).not.toBeNull() await comfyPage.subgraph.rightClickInputSlot(initialInputLabel!) await comfyPage.contextMenu.clickLitegraphMenuItem('Rename Slot') @@ -135,6 +136,7 @@ test.describe('Subgraph Operations', { tag: ['@slow', '@subgraph'] }, () => { await subgraphNode.navigateIntoSubgraph() const initialInputLabel = await comfyPage.subgraph.getSlotLabel('input') + expect(initialInputLabel).not.toBeNull() await comfyPage.subgraph.doubleClickInputSlot(initialInputLabel!) @@ -161,6 +163,7 @@ test.describe('Subgraph Operations', { tag: ['@slow', '@subgraph'] }, () => { await subgraphNode.navigateIntoSubgraph() const initialOutputLabel = await comfyPage.subgraph.getSlotLabel('output') + expect(initialOutputLabel).not.toBeNull() await comfyPage.subgraph.doubleClickOutputSlot(initialOutputLabel!) @@ -190,6 +193,7 @@ test.describe('Subgraph Operations', { tag: ['@slow', '@subgraph'] }, () => { await subgraphNode.navigateIntoSubgraph() const initialInputLabel = await comfyPage.subgraph.getSlotLabel('input') + expect(initialInputLabel).not.toBeNull() // Test that right-click still works for renaming await comfyPage.subgraph.rightClickInputSlot(initialInputLabel!) diff --git a/browser_tests/tests/subgraphLegacyPrefixedProxyWidgets.spec.ts b/browser_tests/tests/subgraphLegacyPrefixedProxyWidgets.spec.ts index 8d511cf061..8667a4a2ac 100644 --- a/browser_tests/tests/subgraphLegacyPrefixedProxyWidgets.spec.ts +++ b/browser_tests/tests/subgraphLegacyPrefixedProxyWidgets.spec.ts @@ -31,11 +31,14 @@ test.describe( test('Loads without console warnings about failed widget resolution', async ({ comfyPage }) => { - const { warnings } = SubgraphHelper.collectConsoleWarnings(comfyPage.page) + const { warnings, dispose } = SubgraphHelper.collectConsoleWarnings( + comfyPage.page + ) await comfyPage.workflow.loadWorkflow(WORKFLOW) expect(warnings).toEqual([]) + dispose() }) test('Promoted widget renders with normalized name, not legacy prefix', async ({ diff --git a/browser_tests/tests/subgraphNestedConfigureOrder.spec.ts b/browser_tests/tests/subgraphNestedConfigureOrder.spec.ts index 9c76c71a2a..aa4833e769 100644 --- a/browser_tests/tests/subgraphNestedConfigureOrder.spec.ts +++ b/browser_tests/tests/subgraphNestedConfigureOrder.spec.ts @@ -9,14 +9,15 @@ test.describe('Nested subgraph configure order', { tag: ['@subgraph'] }, () => { test('Loads without "No link found" or "Failed to resolve legacy -1" console warnings', async ({ comfyPage }) => { - const { warnings } = SubgraphHelper.collectConsoleWarnings(comfyPage.page, [ - 'No link found', - 'Failed to resolve legacy -1' - ]) + const { warnings, dispose } = SubgraphHelper.collectConsoleWarnings( + comfyPage.page, + ['No link found', 'Failed to resolve legacy -1'] + ) await comfyPage.workflow.loadWorkflow(WORKFLOW) expect(warnings).toEqual([]) + dispose() }) test('All three subgraph levels resolve promoted widgets', async ({ diff --git a/browser_tests/tests/subgraphSearchAliases.spec.ts b/browser_tests/tests/subgraphSearchAliases.spec.ts index 39daf88f35..e1f416da08 100644 --- a/browser_tests/tests/subgraphSearchAliases.spec.ts +++ b/browser_tests/tests/subgraphSearchAliases.spec.ts @@ -5,7 +5,7 @@ import { comfyPageFixture as test } from '../fixtures/ComfyPage' async function createSubgraphAndNavigateInto(comfyPage: ComfyPage) { const subgraphNode = - await comfyPage.subgraph.convertDefaultKSamplerToSubgraph() + await comfyPage.subgraph.loadDefaultAndConvertKSamplerToSubgraph() await subgraphNode.navigateIntoSubgraph() return subgraphNode }