#NEWLINE# def step2( self ) : #NEWLINE# #INDENT# print ( '\nStep 2: setText' ) #NEWLINE# self . window . liveView ( True ) #NEWLINE# self . window . notesEdit . setText ( '# head1\n\n## head2\n[subpageOne](pageOne/subpageOne)' ) #NEWLINE# self . window . saveCurrentNote ( ) #NEWLINE# self . window . notesView . updateView ( ) #NEWLINE# elemCol = self . window . notesView . page ( ) . mainFrame ( ) . findAllElements ( 'a' ) #NEWLINE# element = elemCol . at ( 2 ) #NEWLINE# print ( self . window . notesView . page ( ) . mainFrame ( ) . toHtml ( ) ) #NEWLINE# print ( element . attribute ( 'href' ) ) #NEWLINE# element . evaluateJavaScript ( "var evObj = document.createEvent('MouseEvents');evObj.initEvent( 'click', true, true );this.dispatchEvent(evObj);" ) #NEWLINE# noteName = self . window . notesTree . currentItem ( ) . text ( 0 ) #NEWLINE# self . assertEqual ( noteName , 'subpageOne' )