-
Notifications
You must be signed in to change notification settings - Fork 670
test: cover ECS bridge history and first-run regressions #15536
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
Open
DrJKL
wants to merge
6
commits into
docs/ecs-migration-audit
Choose a base branch
from
test/ecs-migration-behavior-coverage
base: docs/ecs-migration-audit
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7277d4b
test: cover ECS bridge history
ampagent 7af4371
test: close first-run ECS coverage gaps
ampagent 95f1c11
docs: update ECS migration coverage
ampagent 98057d8
test: organize ECS bridge history coverage
ampagent c7e3760
test: load ECS workflow within each test
ampagent 402402b
test: cover non-creating layout reads
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
166 changes: 166 additions & 0 deletions
166
browser_tests/tests/vueNodes/layout/ecsBridgeHistory.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,166 @@ | ||
| import { | ||
| comfyExpect as expect, | ||
| comfyPageFixture as test | ||
| } from '@e2e/fixtures/ComfyPage' | ||
| import { toNodeId } from '@/types/nodeId' | ||
|
|
||
| test.describe( | ||
| 'ECS bridge history', | ||
| { tag: ['@slow', '@subgraph', '@vue-nodes'] }, | ||
| () => { | ||
| test.slow() | ||
|
|
||
| test('restores promoted subgraph state after delete, undo, and redo', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.workflow.loadWorkflow( | ||
| 'subgraphs/subgraph-with-promoted-text-widget' | ||
| ) | ||
|
|
||
| const { baseline, promotedText } = | ||
| await test.step('Capture the initial promoted subgraph state', async () => { | ||
| const baseline = await comfyPage.page.evaluate(() => | ||
| window.app!.graph!.serialize() | ||
| ) | ||
| const promotedText = comfyPage.vueNodes | ||
| .getNodeLocator('11') | ||
| .getByRole('textbox', { name: 'text' }) | ||
| await expect(promotedText).toBeVisible() | ||
| return { baseline, promotedText } | ||
| }) | ||
|
|
||
| await test.step('Delete the subgraph', async () => { | ||
| const host = await comfyPage.vueNodes.getFixtureByTitle('New Subgraph') | ||
| await host.title.click() | ||
| await comfyPage.keyboard.delete() | ||
|
|
||
| await expect(comfyPage.vueNodes.nodes).toHaveCount(0) | ||
| await expect(promotedText).toBeHidden() | ||
| }) | ||
|
|
||
| await test.step('Undo and verify the restored subgraph', async () => { | ||
| await comfyPage.keyboard.undo() | ||
| await comfyPage.vueNodes.waitForNodes() | ||
|
|
||
| await expect(comfyPage.vueNodes.nodes).toHaveCount(1) | ||
| await expect(promotedText).toBeVisible() | ||
| await expect | ||
| .poll(() => | ||
| comfyPage.page.evaluate(() => window.app!.graph!.serialize()) | ||
| ) | ||
| .toEqual(baseline) | ||
|
|
||
| await comfyPage.vueNodes.enterSubgraph('11') | ||
| await expect(comfyPage.vueNodes.nodes).toHaveCount(2) | ||
| await expect | ||
| .poll(() => | ||
| comfyPage.page.evaluate(() => window.app!.canvas.graph!.links.size) | ||
| ) | ||
| .toBe(6) | ||
|
|
||
| const interiorGeometry = await comfyPage.canvasOps.getNodeGeometry( | ||
| toNodeId('10') | ||
| ) | ||
| comfyPage.canvasOps.expectSlotsOnNode( | ||
| interiorGeometry, | ||
| 'after restoring the subgraph' | ||
| ) | ||
|
|
||
| await comfyPage.subgraph.exitViaBreadcrumb() | ||
| }) | ||
|
|
||
| await test.step('Redo the deletion', async () => { | ||
| await comfyPage.keyboard.redo() | ||
| await expect(comfyPage.vueNodes.nodes).toHaveCount(0) | ||
| }) | ||
| }) | ||
|
|
||
| test('preserves geometry through navigation, renderer toggle, and history', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.workflow.loadWorkflow( | ||
| 'subgraphs/subgraph-with-promoted-text-widget' | ||
| ) | ||
|
|
||
| const nodeId = toNodeId('11') | ||
|
|
||
| const { before, moved } = | ||
| await test.step('Move the subgraph and capture its geometry', async () => { | ||
| const before = await comfyPage.canvasOps.getNodeGeometry(nodeId) | ||
| const { header } = | ||
| await comfyPage.vueNodes.getFixtureByTitle('New Subgraph') | ||
| const headerBox = await header.boundingBox() | ||
| if (!headerBox) throw new Error('Subgraph header not found') | ||
|
|
||
| const start = { | ||
| x: headerBox.x + headerBox.width / 2, | ||
| y: headerBox.y + headerBox.height / 2 | ||
| } | ||
| await comfyPage.canvasOps.dragAndDrop(start, { | ||
| x: start.x + 120, | ||
| y: start.y + 90 | ||
| }) | ||
| await comfyPage.nextFrame() | ||
|
|
||
| const moved = await comfyPage.canvasOps.getNodeGeometry(nodeId) | ||
| comfyPage.canvasOps.expectSlotsTrackedNode(moved, before) | ||
| await expect.poll(() => comfyPage.workflow.getUndoQueueSize()).toBe(1) | ||
| return { before, moved } | ||
| }) | ||
|
|
||
| await test.step('Verify geometry while navigating the subgraph', async () => { | ||
| await comfyPage.vueNodes.enterSubgraph(nodeId) | ||
| const interiorGeometry = await comfyPage.canvasOps.getNodeGeometry( | ||
| toNodeId('10') | ||
| ) | ||
| comfyPage.canvasOps.expectSlotsOnNode( | ||
| interiorGeometry, | ||
| 'while navigating the subgraph' | ||
| ) | ||
| await comfyPage.subgraph.exitViaBreadcrumb() | ||
| }) | ||
|
|
||
| await test.step('Undo and redo in the legacy renderer', async () => { | ||
| await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', false) | ||
| await expect(comfyPage.vueNodes.nodes).toHaveCount(0) | ||
|
|
||
| await comfyPage.keyboard.undo() | ||
| const undone = await comfyPage.canvasOps.getNodeGeometry(nodeId) | ||
| expect(undone.pos[0]).toBeCloseTo(before.pos[0], 0) | ||
| expect(undone.pos[1]).toBeCloseTo(before.pos[1], 0) | ||
| expect(undone.size).toEqual(before.size) | ||
| comfyPage.canvasOps.expectSlotsOnNode( | ||
| undone, | ||
| 'after undo in the legacy renderer' | ||
| ) | ||
|
|
||
| await comfyPage.keyboard.redo() | ||
| const redone = await comfyPage.canvasOps.getNodeGeometry(nodeId) | ||
| expect(redone.pos[0]).toBeCloseTo(moved.pos[0], 0) | ||
| expect(redone.pos[1]).toBeCloseTo(moved.pos[1], 0) | ||
| expect(redone.size).toEqual(moved.size) | ||
| comfyPage.canvasOps.expectSlotsOnNode( | ||
| redone, | ||
| 'after redo in the legacy renderer' | ||
| ) | ||
| }) | ||
|
|
||
| await test.step('Restore Vue nodes and reload the workflow', async () => { | ||
| await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true) | ||
| await comfyPage.vueNodes.waitForNodes() | ||
| await expect( | ||
| comfyPage.vueNodes | ||
| .getNodeLocator(nodeId) | ||
| .getByRole('textbox', { name: 'text' }) | ||
| ).toBeVisible() | ||
|
|
||
| await comfyPage.subgraph.serializeAndReload() | ||
| comfyPage.canvasOps.expectNodeGeometryPreserved( | ||
| await comfyPage.canvasOps.getNodeGeometry(nodeId), | ||
| moved, | ||
| 'after serialization and reload' | ||
| ) | ||
| }) | ||
| }) | ||
| } | ||
| ) | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.