-
Notifications
You must be signed in to change notification settings - Fork 672
test: cover boundary link preservation on subgraph creation #15064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+102
−0
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eb59077
test: cover boundary link preservation on subgraph creation
4e821e2
test: dump graph state in the boundary link assertion diff
1d37541
Revert "test: dump graph state in the boundary link assertion diff"
0566c82
test: assert the exact post-conversion link topology
269a12a
test: select both nodes before converting to a subgraph
18aae29
test: read the declared id off the selected item
85f173e
Merge branch 'main' into cb/track-a-subgraph-creation-repro
christian-byrne acfdb9e
Merge branch 'main' into cb/track-a-subgraph-creation-repro
DrJKL 625912a
test: simplify subgraph boundary link coverage
DrJKL bf99d70
test: extract node title viewport wait
DrJKL 74a1030
test: validate subgraph output link types
DrJKL 5a2d47d
Merge branch 'main' into cb/track-a-subgraph-creation-repro
DrJKL 7a03b0c
test: use rendered node viewport assertion
ampagent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
browser_tests/tests/subgraph/subgraphCreationBoundaryLinks.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage' | ||
|
|
||
| const SUBGRAPH_LINKS_EXPECTED = { | ||
| rootLinks: [ | ||
| '4:0->HOST:0', | ||
| '4:1->6:0', | ||
| '4:1->7:0', | ||
| '4:2->HOST:4', | ||
| '5:0->HOST:3', | ||
| '6:0->HOST:1', | ||
| '7:0->HOST:2', | ||
| 'HOST:0->9:0' | ||
| ], | ||
| incompatibleHostInputLinks: [], | ||
| incompatibleHostOutputLinks: [] | ||
| } as const | ||
|
|
||
| test( | ||
| 'Subgraph creation rewires boundary links to compatible slots across reload', | ||
| { tag: ['@slow', '@subgraph', '@vue-nodes'] }, | ||
| async ({ comfyPage }) => { | ||
| await test.step('Select both nodes in the default workflow', async () => { | ||
| await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled') | ||
| await comfyPage.workflow.loadWorkflow('default') | ||
|
|
||
| // VAE Decode sits past the right edge of the 1280px canvas at the default | ||
| // view, so clicking its title silently misses and the selection is left | ||
| // holding KSampler alone. | ||
| await comfyPage.command.executeCommand('Comfy.Canvas.FitView') | ||
| const vaeDecode = await comfyPage.nodeOps.getNodeRefById('8') | ||
| await vaeDecode.waitForTitleInView() | ||
|
|
||
| await comfyPage.nodeOps.selectNodes(['KSampler', 'VAE Decode']) | ||
| expect( | ||
| await comfyPage.nodeOps.getSelectedNodeIds(), | ||
| 'both nodes must be selected, or the conversion under test is not the one being asserted' | ||
| ).toEqual(['3', '8']) | ||
| }) | ||
|
|
||
| await test.step('Convert and verify the boundary links', async () => { | ||
| const ksampler = await comfyPage.nodeOps.getNodeRefById('3') | ||
| await ksampler.convertToSubgraph() | ||
|
|
||
| await expect | ||
| .poll(() => comfyPage.subgraph.getBoundaryLinkSnapshot()) | ||
| .toEqual(SUBGRAPH_LINKS_EXPECTED) | ||
| }) | ||
|
|
||
| await test.step('Reload and verify the boundary links', async () => { | ||
| await comfyPage.subgraph.serializeAndReload() | ||
|
|
||
| await expect | ||
| .poll(() => comfyPage.subgraph.getBoundaryLinkSnapshot()) | ||
| .toEqual(SUBGRAPH_LINKS_EXPECTED) | ||
| }) | ||
| } | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixture is pretty clunky. It's sole caller is a
@vue-nodestest, but instead of leveraging thisIt's implemented as a slow
.poll()over the position of the not actually rendered litegraph node.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were right, and it's done in 7a03b0c — the fixture is gone and the step now uses exactly what you suggested:
litegraphUtils.tsis no longer touched at all; the diff is down to two files, +102/-0. Leaving this thread for you to resolve rather than closing it myself.Re-assigning to you — your approval was auto-dismissed by the pushes that followed it, not withdrawn.