Skip to content

Commit 3484aea

Browse files
authored
Merge pull request #383 from FalkorDB/fixTest
Fix canvas test
2 parents 5ca8402 + b029b54 commit 3484aea

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

e2e/config/testData.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ export const nodes: { nodeName: string; }[] = [
2626
{ nodeName: "list_graphs"}
2727
];
2828

29-
export const categories: string[] = ['File', 'Class', 'Function'];
29+
export const categories: string[] = ['File', 'Class', 'Function'];
30+
31+
export const graphs: { graphName: string; }[] = [
32+
{ graphName: "GraphRAG-SDK" },
33+
{ graphName: "click" },
34+
];

e2e/tests/canvas.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import CodeGraph from "../logic/POM/codeGraph";
44
import urls from "../config/urls.json";
55
import { GRAPH_ID, PROJECT_NAME } from "../config/constants";
66
import { findNodeByName } from "../logic/utils";
7-
import { nodesPath, categories, nodes } from "../config/testData";
7+
import { nodesPath, categories, nodes, graphs } from "../config/testData";
88
import { ApiCalls } from "../logic/api/apiCalls";
99

1010
test.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

Comments
 (0)