@@ -25,28 +25,26 @@ test.describe('Node Interaction', () => {
25
25
await expect ( comfyPage . canvas ) . toHaveScreenshot ( 'selected-node2.png' )
26
26
} )
27
27
28
- test ( 'Can select multiple nodes with Meta+Click (mac)' , async ( {
29
- comfyPage
30
- } ) => {
31
- const clipNodes = await comfyPage . getNodeRefsByType ( 'CLIPTextEncode' )
32
- for ( const node of clipNodes ) {
33
- await node . click ( 'title' , { modifiers : [ 'Meta' ] } )
34
- }
35
- const selectedNodeCount = await comfyPage . getSelectedGraphNodesCount ( )
36
- expect ( selectedNodeCount ) . toBe ( clipNodes . length )
37
- } )
38
-
39
28
test ( 'Can drag-select nodes with Meta (mac)' , async ( { comfyPage } ) => {
40
29
const clipNodes = await comfyPage . getNodeRefsByType ( 'CLIPTextEncode' )
41
- const { x, y } = await clipNodes [ 0 ] . getPosition ( )
30
+ const clipNode1Pos = await clipNodes [ 0 ] . getPosition ( )
31
+ const clipNode2Pos = await clipNodes [ 1 ] . getPosition ( )
42
32
const offset = 64
43
33
await comfyPage . page . keyboard . down ( 'Meta' )
44
34
await comfyPage . dragAndDrop (
45
- { x : x - offset , y : y - offset } ,
46
- { x : x + offset , y : y + offset }
35
+ {
36
+ x : Math . min ( clipNode1Pos . x , clipNode2Pos . x ) - offset ,
37
+ y : Math . min ( clipNode1Pos . y , clipNode2Pos . y ) - offset
38
+ } ,
39
+ {
40
+ x : Math . max ( clipNode1Pos . x , clipNode2Pos . x ) + offset ,
41
+ y : Math . max ( clipNode1Pos . y , clipNode2Pos . y ) + offset
42
+ }
47
43
)
48
44
await comfyPage . page . keyboard . up ( 'Meta' )
49
- expect ( await comfyPage . getSelectedGraphNodesCount ( ) ) . toBe ( 1 )
45
+ expect ( await comfyPage . getSelectedGraphNodesCount ( ) ) . toBe (
46
+ clipNodes . length
47
+ )
50
48
} )
51
49
} )
52
50
0 commit comments