Spaces:
Running
Running
Update tests and examples for NetworkX ops.
Browse files
examples/Airlines demo
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
examples/NetworkX demo
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
lynxkite-app/web/tests/basic.spec.ts
CHANGED
@@ -35,9 +35,9 @@ test("Box creation & deletion per env", async () => {
|
|
35 |
});
|
36 |
|
37 |
test("Delete multi-handle boxes", async () => {
|
38 |
-
await workspace.addBox("
|
39 |
-
await workspace.deleteBoxes(["
|
40 |
-
await expect(workspace.getBox("
|
41 |
});
|
42 |
|
43 |
test("Drag box", async () => {
|
|
|
35 |
});
|
36 |
|
37 |
test("Delete multi-handle boxes", async () => {
|
38 |
+
await workspace.addBox("NX › PageRank");
|
39 |
+
await workspace.deleteBoxes(["NX › PageRank 1"]);
|
40 |
+
await expect(workspace.getBox("NX › PageRank 1")).not.toBeVisible();
|
41 |
});
|
42 |
|
43 |
test("Drag box", async () => {
|
lynxkite-app/web/tests/errors.spec.ts
CHANGED
@@ -20,24 +20,22 @@ test.afterEach(async () => {
|
|
20 |
test("missing parameter", async () => {
|
21 |
// Test the correct error message is displayed when a required parameter is missing,
|
22 |
// and that the error message is removed when the parameter is filled.
|
23 |
-
await workspace.addBox("
|
24 |
-
const graphBox = workspace.getBox("
|
25 |
-
await graphBox.locator("
|
26 |
-
|
27 |
-
"invalid literal for int() with base 10: ''",
|
28 |
-
);
|
29 |
-
await graphBox.locator("input").fill("10");
|
30 |
await expect(graphBox.locator(".error")).not.toBeVisible();
|
31 |
});
|
32 |
|
33 |
test("unknown operation", async () => {
|
34 |
// Test that the correct error is displayed when the operation does not belong to
|
35 |
// the current environment.
|
36 |
-
await workspace.addBox("
|
37 |
await workspace.setEnv("LynxScribe");
|
38 |
-
const csvBox = workspace.getBox("
|
39 |
-
|
40 |
-
|
|
|
41 |
await workspace.setEnv("LynxKite Graph Analytics");
|
42 |
await expect(csvBox.locator(".error")).not.toBeVisible();
|
43 |
});
|
|
|
20 |
test("missing parameter", async () => {
|
21 |
// Test the correct error message is displayed when a required parameter is missing,
|
22 |
// and that the error message is removed when the parameter is filled.
|
23 |
+
await workspace.addBox("NX › Scale-Free Graph");
|
24 |
+
const graphBox = workspace.getBox("NX › Scale-Free Graph 1");
|
25 |
+
await expect(graphBox.locator(".error")).toHaveText("n is unset.");
|
26 |
+
await graphBox.getByLabel("n").fill("10");
|
|
|
|
|
|
|
27 |
await expect(graphBox.locator(".error")).not.toBeVisible();
|
28 |
});
|
29 |
|
30 |
test("unknown operation", async () => {
|
31 |
// Test that the correct error is displayed when the operation does not belong to
|
32 |
// the current environment.
|
33 |
+
await workspace.addBox("NX › Scale-Free Graph");
|
34 |
await workspace.setEnv("LynxScribe");
|
35 |
+
const csvBox = workspace.getBox("NX › Scale-Free Graph 1");
|
36 |
+
await expect(csvBox.locator(".error")).toHaveText(
|
37 |
+
'Operation "NX › Scale-Free Graph" not found.',
|
38 |
+
);
|
39 |
await workspace.setEnv("LynxKite Graph Analytics");
|
40 |
await expect(csvBox.locator(".error")).not.toBeVisible();
|
41 |
});
|
lynxkite-app/web/tests/examples.spec.ts
CHANGED
@@ -23,13 +23,13 @@ test.fail("AIMO example", async ({ page }) => {
|
|
23 |
await ws.expectErrorFree();
|
24 |
});
|
25 |
|
26 |
-
test
|
27 |
// Fails because of missing OPENAI_API_KEY
|
28 |
const ws = await Workspace.open(page, "LynxScribe demo");
|
29 |
await ws.expectErrorFree();
|
30 |
});
|
31 |
|
32 |
-
test
|
33 |
// Fails due to some issue with ChromaDB
|
34 |
const ws = await Workspace.open(page, "Graph RAG");
|
35 |
await ws.expectErrorFree(process.env.CI ? 2000 : 500);
|
|
|
23 |
await ws.expectErrorFree();
|
24 |
});
|
25 |
|
26 |
+
test("LynxScribe example", async ({ page }) => {
|
27 |
// Fails because of missing OPENAI_API_KEY
|
28 |
const ws = await Workspace.open(page, "LynxScribe demo");
|
29 |
await ws.expectErrorFree();
|
30 |
});
|
31 |
|
32 |
+
test("Graph RAG", async ({ page }) => {
|
33 |
// Fails due to some issue with ChromaDB
|
34 |
const ws = await Workspace.open(page, "Graph RAG");
|
35 |
await ws.expectErrorFree(process.env.CI ? 2000 : 500);
|
lynxkite-app/web/tests/graph_creation.spec.ts
CHANGED
@@ -9,9 +9,13 @@ test.beforeEach(async ({ browser }) => {
|
|
9 |
await browser.newPage(),
|
10 |
"graph_creation_spec_test",
|
11 |
);
|
12 |
-
await workspace.addBox("
|
|
|
|
|
|
|
|
|
13 |
await workspace.addBox("Create graph");
|
14 |
-
await workspace.connectBoxes("
|
15 |
});
|
16 |
|
17 |
test.afterEach(async () => {
|
|
|
9 |
await browser.newPage(),
|
10 |
"graph_creation_spec_test",
|
11 |
);
|
12 |
+
await workspace.addBox("NX › Scale-Free Graph");
|
13 |
+
await workspace
|
14 |
+
.getBox("NX › Scale-Free Graph 1")
|
15 |
+
.getByLabel("n", { exact: true })
|
16 |
+
.fill("10");
|
17 |
await workspace.addBox("Create graph");
|
18 |
+
await workspace.connectBoxes("NX › Scale-Free Graph 1", "Create graph 1");
|
19 |
});
|
20 |
|
21 |
test.afterEach(async () => {
|
lynxkite-app/web/tests/lynxkite.ts
CHANGED
@@ -65,7 +65,10 @@ export class Workspace {
|
|
65 |
// Some x,y offset, otherwise the box handle may fall outside the viewport.
|
66 |
await this.page.locator(".ws-name").click();
|
67 |
await this.page.keyboard.press("/");
|
68 |
-
await this.page
|
|
|
|
|
|
|
69 |
await expect(this.getBoxes()).toHaveCount(allBoxes.length + 1);
|
70 |
}
|
71 |
|
|
|
65 |
// Some x,y offset, otherwise the box handle may fall outside the viewport.
|
66 |
await this.page.locator(".ws-name").click();
|
67 |
await this.page.keyboard.press("/");
|
68 |
+
await this.page
|
69 |
+
.locator(".node-search")
|
70 |
+
.getByText(boxName, { exact: true })
|
71 |
+
.click();
|
72 |
await expect(this.getBoxes()).toHaveCount(allBoxes.length + 1);
|
73 |
}
|
74 |
|