@@ -4,7 +4,7 @@ import CodeGraph from "../logic/POM/codeGraph";
44import urls from "../config/urls.json" ;
55import { GRAPH_ID , PROJECT_NAME } from "../config/constants" ;
66import { findNodeByName } from "../logic/utils" ;
7- import { nodesPath , categories , nodes } from "../config/testData" ;
7+ import { nodesPath , categories , nodes , graphs } from "../config/testData" ;
88import { ApiCalls } from "../logic/api/apiCalls" ;
99
1010test . describe ( "Canvas tests" , ( ) => {
@@ -117,16 +117,15 @@ test.describe("Canvas tests", () => {
117117 } ) ;
118118 } )
119119
120- for ( let index = 0 ; index < 2 ; index ++ ) {
121- const checkboxIndex = index + 1 ;
122- test ( `Verify selecting different graphs displays nodes in canvas - Iteration ${ index + 1 } ` , async ( ) => {
120+ graphs . forEach ( ( { graphName} ) => {
121+ test ( `Verify selecting different graphs displays nodes in canvas - grpah: ${ graphName } ` , async ( ) => {
123122 const codeGraph = await browser . createNewPage ( CodeGraph , urls . baseUrl ) ;
124- await codeGraph . selectGraph ( checkboxIndex ) ;
123+ await codeGraph . selectGraph ( graphName ) ;
125124 const result = await codeGraph . getGraphDetails ( ) ;
126125 expect ( result . elements . nodes . length ) . toBeGreaterThan ( 1 ) ;
127126 expect ( result . elements . links . length ) . toBeGreaterThan ( 1 ) ;
128127 } ) ;
129- }
128+ } )
130129
131130 for ( let index = 0 ; index < 3 ; index ++ ) {
132131 const nodeIndex : number = index + 1 ;
0 commit comments