-
Notifications
You must be signed in to change notification settings - Fork 672
Expand file tree
/
Copy pathsubgraphCreationBoundaryLinks.spec.ts
More file actions
59 lines (50 loc) · 1.95 KB
/
Copy pathsubgraphCreationBoundaryLinks.spec.ts
File metadata and controls
59 lines (50 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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)
})
}
)