@@ -35,12 +35,12 @@ public async Task CreateNewProject()
3535
3636 public async Task HasClass ( string name )
3737 {
38- await SearchProjectExplorerClasses . GetByText ( name ) . WaitForVisible ( ) ;
38+ await SearchProjectExplorerClasses . GetByText ( name , new ( ) { Exact = true } ) . WaitForVisible ( ) ;
3939 }
4040
4141 public async Task ClickClass ( string name )
4242 {
43- await SearchProjectExplorerClasses . GetByText ( name ) . ClickAsync ( ) ;
43+ await SearchProjectExplorerClasses . GetByText ( name , new ( ) { Exact = true } ) . ClickAsync ( ) ;
4444 }
4545
4646 public async Task OpenProjectExplorerProjectTab ( )
@@ -755,4 +755,61 @@ public async Task<string[]> GetConsoleOutput()
755755 }
756756 return lines . ToArray ( ) ;
757757 }
758+
759+ // Breakpoint Operations
760+
761+ public async Task ClickToggleBreakpointButton ( )
762+ {
763+ var toggleButton = _user . Locator ( "[data-test-id='toggle-breakpoint']" ) ;
764+ await toggleButton . WaitForVisible ( ) ;
765+ await toggleButton . ClickAsync ( ) ;
766+ Console . WriteLine ( "Clicked toggle breakpoint button" ) ;
767+ }
768+
769+ public async Task VerifyNodeHasBreakpoint ( string nodeName )
770+ {
771+ var node = GetGraphNode ( nodeName ) ;
772+ var breakpointIndicator = node . Locator ( ".breakpoint-indicator" ) ;
773+
774+ try
775+ {
776+ await breakpointIndicator . WaitForAsync ( new ( ) { State = WaitForSelectorState . Visible , Timeout = 5000 } ) ;
777+ Console . WriteLine ( $ "Verified node '{ nodeName } ' has breakpoint indicator") ;
778+ }
779+ catch ( TimeoutException )
780+ {
781+ throw new Exception ( $ "Node '{ nodeName } ' does not have a breakpoint indicator") ;
782+ }
783+ }
784+
785+ public async Task VerifyNodeHasNoBreakpoint ( string nodeName )
786+ {
787+ var node = GetGraphNode ( nodeName ) ;
788+ var breakpointIndicator = node . Locator ( ".breakpoint-indicator" ) ;
789+ var count = await breakpointIndicator . CountAsync ( ) ;
790+
791+ if ( count > 0 )
792+ {
793+ throw new Exception ( $ "Node '{ nodeName } ' has a breakpoint indicator when it shouldn't") ;
794+ }
795+
796+ Console . WriteLine ( $ "Verified node '{ nodeName } ' has no breakpoint indicator") ;
797+ }
798+
799+ public async Task AddNodeToCanvas ( string nodeType )
800+ {
801+ // Click the add node button
802+ var addNodeButton = _user . Locator ( "[data-test-id='node-search']" ) ;
803+ await addNodeButton . WaitForVisible ( ) ;
804+ await addNodeButton . ClickAsync ( ) ;
805+ await Task . Delay ( 200 ) ;
806+
807+ // Find and click the node type in the list
808+ var nodeItem = _user . GetByText ( nodeType , new ( ) { Exact = true } ) ;
809+ await nodeItem . WaitForVisible ( ) ;
810+ await nodeItem . ClickAsync ( ) ;
811+ await Task . Delay ( 300 ) ;
812+
813+ Console . WriteLine ( $ "Added node '{ nodeType } ' to canvas") ;
814+ }
758815}
0 commit comments