@@ -179,25 +179,27 @@ public async Task DragNodeTo(string nodeName, float targetX, float targetY)
179179 if ( box == null )
180180 throw new Exception ( $ "Could not get bounding box for node '{ nodeName } '") ;
181181
182- await node . ClickAsync ( ) ;
183-
184182 // Calculate center of node as the starting point
185183 var sourceX = ( float ) ( box . X + box . Width / 2 ) ;
186184 var sourceY = ( float ) ( box . Y + box . Height / 2 ) ;
187185
188186 Console . WriteLine ( $ "Dragging { nodeName } from ({ sourceX } , { sourceY } ) to ({ targetX } , { targetY } )") ;
189187
190- // Perform manual drag with proper event sequence for Blazor.Diagrams
191- // 1. Move mouse to starting position
188+ // Dismiss any hover UI left by the preceding action (for example, a MudBlazor
189+ // tooltip from a node-search result) before interacting with the diagram node.
190+ await _user . Mouse . MoveAsync ( 0 , 0 ) ;
191+
192+ // Perform manual drag with proper event sequence for Blazor.Diagrams.
193+ // Moving to the node and pressing the mouse button selects it and starts the drag;
194+ // a separate click is both redundant and vulnerable to transient popovers.
192195 await _user . Mouse . MoveAsync ( sourceX , sourceY ) ;
193- // 2. Press mouse button down (pointerdown event)
194196 await _user . Mouse . DownAsync ( ) ;
195197 await Task . Delay ( 50 ) ; // Single delay for event propagation
196198
197- // 3. Move mouse to target position with multiple steps (pointermove events)
199+ // Move mouse to target position with multiple steps (pointermove events)
198200 await _user . Mouse . MoveAsync ( targetX , targetY , new ( ) { Steps = 15 } ) ;
199201
200- // 4. Release mouse button (pointerup event)
202+ // Release mouse button (pointerup event)
201203 await _user . Mouse . UpAsync ( ) ;
202204
203205 // Wait for the UI to update after drag
@@ -316,7 +318,11 @@ public async Task DeleteConnection(string sourceNodeName, string sourcePortName,
316318
317319 public async Task TakeScreenshot ( string fileName )
318320 {
319- await _user . ScreenshotAsync ( new ( ) { Path = fileName } ) ;
321+ var screenshotPath = fileName ;
322+ if ( OperatingSystem . IsWindows ( ) && fileName . StartsWith ( "/tmp/" , StringComparison . Ordinal ) )
323+ screenshotPath = Path . Combine ( Path . GetTempPath ( ) , fileName [ "/tmp/" . Length ..] ) ;
324+
325+ await _user . ScreenshotAsync ( new ( ) { Path = screenshotPath } ) ;
320326 }
321327
322328 // Advanced Node Operations
0 commit comments