@@ -2,10 +2,10 @@ import { test, expect } from "@playwright/test";
22import BrowserWrapper from "../infra/ui/browserWrapper" ;
33import CodeGraph from "../logic/POM/codeGraph" ;
44import urls from "../config/urls.json" ;
5- import { FLASK_GRAPH , GRAPHRAG_SDK , } from "../config/constants" ;
5+ import { FLASK_GRAPH , GRAPHRAG_SDK } from "../config/constants" ;
6+ import { findNodeByName , findFirstNodeWithSrc , findNodeWithSpecificSrc } from "../logic/utils" ;
67import { nodes } from "../config/testData" ;
78import { ApiCalls } from "../logic/api/apiCalls" ;
8- import { findFirstNodeWithSrc , findNodeByName } from "../logic/utils" ;
99
1010test . describe ( "Node details panel tests" , ( ) => {
1111 let browser : BrowserWrapper ;
@@ -58,17 +58,21 @@ test.describe("Node details panel tests", () => {
5858 } )
5959
6060
61- test ( `Validate copy functionality for node inside node details panel and verify with api` , async ( ) => {
61+ test . only ( `Validate copy functionality for node inside node details panel and verify with api` , async ( ) => {
62+ const api = new ApiCalls ( ) ;
63+ const response = await api . getProject ( FLASK_GRAPH ) ;
64+
6265 const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
6366 await browser . setPageToFullScreen ( ) ;
6467 await codeGraph . selectGraph ( FLASK_GRAPH ) ;
6568 const graphData = await codeGraph . getGraphNodes ( ) ;
66- const targetNode = findFirstNodeWithSrc ( graphData ) ;
69+ const targetNode = findNodeWithSpecificSrc ( graphData , "test_options_work" ) ;
70+
71+ await new Promise ( resolve => setTimeout ( resolve , 2000 ) ) ;
6772 await codeGraph . nodeClick ( targetNode . screenX , targetNode . screenY ) ;
6873 await codeGraph . clickOnViewNode ( ) ;
6974 const result = await codeGraph . clickOnCopyToClipboardNodePanelDetails ( ) ;
70- const api = new ApiCalls ( ) ;
71- const response = await api . getProject ( FLASK_GRAPH ) ;
75+
7276 const foundNode = response . result . entities . nodes . find ( ( nod ) => nod . properties ?. name === targetNode . name ) ;
7377 expect ( foundNode ?. properties . src ) . toBe ( result ) ;
7478 } ) ;
0 commit comments