From 5e4cb374eadb208cdb206f2d69aa0045d72155e7 Mon Sep 17 00:00:00 2001 From: DrJKL Date: Fri, 22 May 2026 18:53:31 -0700 Subject: [PATCH] test: edit promoted widget from outer subgraph node Amp-Thread-ID: https://ampcode.com/threads/T-019e527c-df63-7105-835f-905d9141d11f Co-authored-by: Amp --- ...subgraphDuplicateIndependentValues.spec.ts | 50 ++++--------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/browser_tests/tests/subgraph/subgraphDuplicateIndependentValues.spec.ts b/browser_tests/tests/subgraph/subgraphDuplicateIndependentValues.spec.ts index 9a156bdd9f..17429a82f2 100644 --- a/browser_tests/tests/subgraph/subgraphDuplicateIndependentValues.spec.ts +++ b/browser_tests/tests/subgraph/subgraphDuplicateIndependentValues.spec.ts @@ -40,49 +40,19 @@ test.describe( ) const [nodeId1, nodeId2] = nodeIds - // Enter first subgraph, set text widget value - await comfyPage.vueNodes.enterSubgraph(nodeId1) - await comfyPage.vueNodes.waitForNodes() - const textarea1 = comfyPage.vueNodes - .getNodeByTitle(clipNodeTitle) - .first() - .getByRole('textbox', { name: 'text' }) - await textarea1.fill('subgraph1_value') - await expect(textarea1).toHaveValue('subgraph1_value') - await comfyPage.subgraph.exitViaBreadcrumb() + const promotedTextarea = (nodeId: string) => + comfyPage.vueNodes + .getNodeLocator(nodeId) + .getByRole('textbox', { name: 'text' }) - // Enter second subgraph, set text widget value - await comfyPage.vueNodes.waitForNodes() - await comfyPage.vueNodes.enterSubgraph(nodeId2) - await comfyPage.vueNodes.waitForNodes() - const textarea2 = comfyPage.vueNodes - .getNodeByTitle(clipNodeTitle) - .first() - .getByRole('textbox', { name: 'text' }) - await textarea2.fill('subgraph2_value') - await expect(textarea2).toHaveValue('subgraph2_value') - await comfyPage.subgraph.exitViaBreadcrumb() + await promotedTextarea(nodeId1).fill('subgraph1_value') + await expect(promotedTextarea(nodeId1)).toHaveValue('subgraph1_value') - // Re-enter first subgraph, assert value preserved - await comfyPage.vueNodes.waitForNodes() - await comfyPage.vueNodes.enterSubgraph(nodeId1) - await comfyPage.vueNodes.waitForNodes() - const textarea1Again = comfyPage.vueNodes - .getNodeByTitle(clipNodeTitle) - .first() - .getByRole('textbox', { name: 'text' }) - await expect(textarea1Again).toHaveValue('subgraph1_value') - await comfyPage.subgraph.exitViaBreadcrumb() + await promotedTextarea(nodeId2).fill('subgraph2_value') + await expect(promotedTextarea(nodeId2)).toHaveValue('subgraph2_value') - // Re-enter second subgraph, assert value preserved - await comfyPage.vueNodes.waitForNodes() - await comfyPage.vueNodes.enterSubgraph(nodeId2) - await comfyPage.vueNodes.waitForNodes() - const textarea2Again = comfyPage.vueNodes - .getNodeByTitle(clipNodeTitle) - .first() - .getByRole('textbox', { name: 'text' }) - await expect(textarea2Again).toHaveValue('subgraph2_value') + await expect(promotedTextarea(nodeId1)).toHaveValue('subgraph1_value') + await expect(promotedTextarea(nodeId2)).toHaveValue('subgraph2_value') }) } )