@@ -228,9 +228,9 @@ export default class CodeGraph extends BasePage {
228228 private get copyToClipboardNodePanelDetails ( ) : Locator {
229229 return this . page . locator ( `//div[@data-name='node-details-panel']//button[@title='Copy src to clipboard']` ) ;
230230 }
231-
232- private get nodeToolTip ( ) : Locator {
233- return this . page . locator ( " //div[contains(@class, 'graph-tooltip ')]" ) ;
231+
232+ private get nodeToolTip ( ) : ( node : string ) => Locator {
233+ return ( node : string ) => this . page . locator ( ` //div[contains(@class, 'force- graph-container ')]/div[contains(text(), ' ${ node } ')]` ) ;
234234 }
235235
236236 private get downloadImageBtn ( ) : Locator {
@@ -667,21 +667,21 @@ export default class CodeGraph extends BasePage {
667667 await this . page . mouse . move ( centerX , centerY ) ;
668668 }
669669
670- async isNodeToolTipVisible ( ) : Promise < boolean > {
670+ async isNodeToolTipVisible ( node : string ) : Promise < boolean > {
671671 try {
672672 await this . page . waitForTimeout ( 10000 ) ;
673- const count = await this . nodeToolTip . count ( ) ;
673+ const count = await this . nodeToolTip ( node ) . count ( ) ;
674674 if ( count === 0 ) {
675675 console . error ( "Tooltip not found" ) ;
676676 return false ;
677677 }
678678
679- const box = await this . nodeToolTip . boundingBox ( ) ;
679+ const box = await this . nodeToolTip ( node ) . boundingBox ( ) ;
680680 if ( box && box . width > 0 && box . height > 0 ) {
681681 return true ;
682682 }
683683
684- return await this . nodeToolTip . evaluate ( el => {
684+ return await this . nodeToolTip ( node ) . evaluate ( el => {
685685 const style = getComputedStyle ( el ) ;
686686 return style . visibility === 'visible' && parseFloat ( style . opacity ) > 0 ;
687687 } ) ;
0 commit comments