@@ -2,24 +2,24 @@ import { expect } from '@playwright/test'
22
33import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
44
5+ const SUBGRAPH_LINKS_EXPECTED = {
6+ rootLinks : [
7+ '4:0->HOST:0' ,
8+ '4:1->6:0' ,
9+ '4:1->7:0' ,
10+ '4:2->HOST:4' ,
11+ '5:0->HOST:3' ,
12+ '6:0->HOST:1' ,
13+ '7:0->HOST:2' ,
14+ 'HOST:0->9:0'
15+ ] ,
16+ incompatibleHostInputLinks : [ ]
17+ } as const
18+
519test (
620 'Subgraph creation rewires boundary links to compatible slots across reload' ,
721 { tag : [ '@slow' , '@subgraph' , '@vue-nodes' ] } ,
822 async ( { comfyPage } ) => {
9- const expectedSnapshot = {
10- rootLinks : [
11- '4:0->HOST:0' ,
12- '4:1->6:0' ,
13- '4:1->7:0' ,
14- '4:2->HOST:4' ,
15- '5:0->HOST:3' ,
16- '6:0->HOST:1' ,
17- '7:0->HOST:2' ,
18- 'HOST:0->9:0'
19- ] ,
20- incompatibleHostInputLinks : [ ]
21- }
22-
2323 await test . step ( 'Select both nodes in the default workflow' , async ( ) => {
2424 await comfyPage . settings . setSetting ( 'Comfy.UseNewMenu' , 'Disabled' )
2525 await comfyPage . workflow . loadWorkflow ( 'default' )
2929 // holding KSampler alone.
3030 await comfyPage . command . executeCommand ( 'Comfy.Canvas.FitView' )
3131 const vaeDecode = await comfyPage . nodeOps . getNodeRefById ( '8' )
32- const canvasWidth = ( await comfyPage . canvas . boundingBox ( ) ) ! . width
33- let previousX = Number . NaN
34- await expect
35- . poll ( async ( ) => {
36- const { x } = await vaeDecode . getTitlePosition ( )
37- const settledInView = x === previousX && x < canvasWidth
38- previousX = x
39- return settledInView
40- } )
41- . toBe ( true )
32+ await vaeDecode . waitForTitleInView ( )
4233
4334 await comfyPage . nodeOps . selectNodes ( [ 'KSampler' , 'VAE Decode' ] )
4435 expect (
@@ -53,15 +44,15 @@ test(
5344
5445 await expect
5546 . poll ( ( ) => comfyPage . subgraph . getBoundaryLinkSnapshot ( ) )
56- . toEqual ( expectedSnapshot )
47+ . toEqual ( SUBGRAPH_LINKS_EXPECTED )
5748 } )
5849
5950 await test . step ( 'Reload and verify the boundary links' , async ( ) => {
6051 await comfyPage . subgraph . serializeAndReload ( )
6152
6253 await expect
6354 . poll ( ( ) => comfyPage . subgraph . getBoundaryLinkSnapshot ( ) )
64- . toEqual ( expectedSnapshot )
55+ . toEqual ( SUBGRAPH_LINKS_EXPECTED )
6556 } )
6657 }
6758)
0 commit comments