From 26c2513cd8d04da97c547485ada92804e3cb8438 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Sun, 7 Apr 2024 14:38:37 +0300 Subject: [PATCH 01/12] change the navbar structure --- app/providers.tsx | 2 +- components/custom/navbar.tsx | 107 +++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 32 deletions(-) diff --git a/app/providers.tsx b/app/providers.tsx index c7bb4526..bfabe05f 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -77,7 +77,7 @@ export default function NextAuthProvider({ children }: { children: React.ReactNo minSize={panelSize} onCollapse={() => { setCollapsed(true) }} onExpand={() => { setCollapsed(false) }}> - + {children} diff --git a/components/custom/navbar.tsx b/components/custom/navbar.tsx index 904429af..1f5f66c0 100644 --- a/components/custom/navbar.tsx +++ b/components/custom/navbar.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ -import { Menu } from "lucide-react"; -import { useSession } from "next-auth/react"; +import { Activity, Info, LogOut, Menu, Waypoints } from "lucide-react"; +import { signOut, useSession } from "next-auth/react"; import Link from "next/link"; import { useEffect, useState } from "react"; import { useTheme } from "next-themes"; @@ -17,7 +17,35 @@ export interface LinkDefinition { onClick?: () => void } -export default function Navbar({ links, collapsed, onExpand }: { links: LinkDefinition[], collapsed: boolean, onExpand:()=>void }) { +const linksUp: LinkDefinition[] = [ + { + name: "Connection Details", + href: "/details", + icon: (), + }, + { + name: "Graph", + href: "/graph", + icon: (), + }, + { + name: "Monitor", + // href: "/api/monitor", + href: "/monitor", + icon: (), + }, +] + +const linksDown: LinkDefinition[] = [ + { + name: "Disconnect", + href: "", + icon: (), + onClick: () => { signOut({ callbackUrl: '/login' }) } + }, +] + +export default function Navbar({ collapsed, onExpand }: { collapsed: boolean, onExpand: () => void }) { const { status } = useSession() const { theme, setTheme, systemTheme } = useTheme() @@ -38,42 +66,59 @@ export default function Navbar({ links, collapsed, onExpand }: { links: LinkDefi const darkmode = theme === "dark" || (theme === "system" && systemTheme === "dark") return ( - + - + ) } From e2fe152832cda31d9900e3124dd5c82098df03f7 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:34:49 +0300 Subject: [PATCH 02/12] make the content of the query component take the all space --- app/graph/query.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/graph/query.tsx b/app/graph/query.tsx index 9fbdf157..ba7f254c 100644 --- a/app/graph/query.tsx +++ b/app/graph/query.tsx @@ -58,7 +58,7 @@ export function Query({ onSubmit, onQueryUpdate, onDeleteGraph, className = "" } -
+
Date: Sun, 7 Apr 2024 15:42:59 +0300 Subject: [PATCH 03/12] change the run icon --- app/graph/page.tsx | 2 +- app/graph/query.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/graph/page.tsx b/app/graph/page.tsx index a7cec49a..17ef267e 100644 --- a/app/graph/page.tsx +++ b/app/graph/page.tsx @@ -95,7 +95,7 @@ export default function Page() { return (
{ queryState.current = state }} onDeleteGraph={() => setGraph(Graph.empty())} diff --git a/app/graph/query.tsx b/app/graph/query.tsx index ba7f254c..f9ec7f29 100644 --- a/app/graph/query.tsx +++ b/app/graph/query.tsx @@ -4,7 +4,7 @@ import { Label } from "@/components/ui/label"; import { cn } from "@/lib/utils"; import { useState } from "react"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; -import { Menu, Search, Trash2 } from "lucide-react"; +import { Menu, Play, Search, Trash2 } from "lucide-react"; import { useToast } from "@/components/ui/use-toast"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; @@ -52,7 +52,7 @@ export function Query({ onSubmit, onQueryUpdate, onDeleteGraph, className = "" } return (
@@ -69,10 +69,10 @@ export function Query({ onSubmit, onQueryUpdate, onDeleteGraph, className = "" } - + -

Query

+

Run Query

From e55e0168cf841b44914129e6821f6ce3b343c477 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:47:56 +0300 Subject: [PATCH 04/12] removing changes from the navbar branch --- app/providers.tsx | 2 +- components/custom/navbar.tsx | 111 ++++++++++------------------------- 2 files changed, 33 insertions(+), 80 deletions(-) diff --git a/app/providers.tsx b/app/providers.tsx index bfabe05f..c7bb4526 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -77,7 +77,7 @@ export default function NextAuthProvider({ children }: { children: React.ReactNo minSize={panelSize} onCollapse={() => { setCollapsed(true) }} onExpand={() => { setCollapsed(false) }}> - + {children} diff --git a/components/custom/navbar.tsx b/components/custom/navbar.tsx index 1f5f66c0..fd375722 100644 --- a/components/custom/navbar.tsx +++ b/components/custom/navbar.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ -import { Activity, Info, LogOut, Menu, Waypoints } from "lucide-react"; -import { signOut, useSession } from "next-auth/react"; +import { Menu } from "lucide-react"; +import { useSession } from "next-auth/react"; import Link from "next/link"; import { useEffect, useState } from "react"; import { useTheme } from "next-themes"; @@ -9,7 +9,6 @@ import { cn } from "@/lib/utils" import { Switch } from "../ui/switch"; import { Label } from "../ui/label"; import GithubMark from "./GithubMark"; - export interface LinkDefinition { name: string, href: string, @@ -17,35 +16,7 @@ export interface LinkDefinition { onClick?: () => void } -const linksUp: LinkDefinition[] = [ - { - name: "Connection Details", - href: "/details", - icon: (), - }, - { - name: "Graph", - href: "/graph", - icon: (), - }, - { - name: "Monitor", - // href: "/api/monitor", - href: "/monitor", - icon: (), - }, -] - -const linksDown: LinkDefinition[] = [ - { - name: "Disconnect", - href: "", - icon: (), - onClick: () => { signOut({ callbackUrl: '/login' }) } - }, -] - -export default function Navbar({ collapsed, onExpand }: { collapsed: boolean, onExpand: () => void }) { +export default function Navbar({ links, collapsed, onExpand }: { links: LinkDefinition[], collapsed: boolean, onExpand:()=>void }) { const { status } = useSession() const { theme, setTheme, systemTheme } = useTheme() @@ -54,7 +25,6 @@ export default function Navbar({ collapsed, onExpand }: { collapsed: boolean, on useEffect(() => { setMounted(true) }, []) - const setDarkMode = (val: boolean) => { if (val) { setTheme("dark") @@ -66,59 +36,42 @@ export default function Navbar({ collapsed, onExpand }: { collapsed: boolean, on const darkmode = theme === "dark" || (theme === "system" && systemTheme === "dark") return ( - <> - ) -} +} \ No newline at end of file From 10158215ae5847c10d6ca67f2bb3899cdc683124 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:21:40 +0300 Subject: [PATCH 05/12] fix lint and remove testing --- app/graph/GraphView.tsx | 2 +- app/graph/query.tsx | 2 +- components/custom/navbar.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/graph/GraphView.tsx b/app/graph/GraphView.tsx index 17558492..fc4e7463 100644 --- a/app/graph/GraphView.tsx +++ b/app/graph/GraphView.tsx @@ -1,6 +1,6 @@ import CytoscapeComponent from "react-cytoscapejs"; import { toast } from "@/components/ui/use-toast"; -import cytoscape, { EdgeCollection, ElementDefinition, EventObject, NodeDataDefinition } from "cytoscape"; +import cytoscape, { ElementDefinition, EventObject, NodeDataDefinition } from "cytoscape"; import { useRef, useState, useImperativeHandle, forwardRef } from "react"; import { signOut } from "next-auth/react"; import fcose from 'cytoscape-fcose'; diff --git a/app/graph/query.tsx b/app/graph/query.tsx index f9ec7f29..08df18b7 100644 --- a/app/graph/query.tsx +++ b/app/graph/query.tsx @@ -4,7 +4,7 @@ import { Label } from "@/components/ui/label"; import { cn } from "@/lib/utils"; import { useState } from "react"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; -import { Menu, Play, Search, Trash2 } from "lucide-react"; +import { Menu, Play, Trash2 } from "lucide-react"; import { useToast } from "@/components/ui/use-toast"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; diff --git a/components/custom/navbar.tsx b/components/custom/navbar.tsx index fd375722..7fd7138f 100644 --- a/components/custom/navbar.tsx +++ b/components/custom/navbar.tsx @@ -9,6 +9,7 @@ import { cn } from "@/lib/utils" import { Switch } from "../ui/switch"; import { Label } from "../ui/label"; import GithubMark from "./GithubMark"; + export interface LinkDefinition { name: string, href: string, From 62cf733746d93d89791ede6626b296ef9d81af2e Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:21:53 +0300 Subject: [PATCH 06/12] remove testing --- e2e/createGraph.spec.ts | 13 ------------- e2e/graph.spec.ts | 29 ----------------------------- e2e/homePage.spec.ts | 18 ------------------ e2e/login.spec.ts | 11 ----------- 4 files changed, 71 deletions(-) delete mode 100644 e2e/createGraph.spec.ts delete mode 100644 e2e/graph.spec.ts delete mode 100644 e2e/homePage.spec.ts delete mode 100644 e2e/login.spec.ts diff --git a/e2e/createGraph.spec.ts b/e2e/createGraph.spec.ts deleted file mode 100644 index 439b830d..00000000 --- a/e2e/createGraph.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { test } from '@playwright/test'; - -test('create graph', async ({ page }) => { - await page.goto('http://localhost:3000/login'); - await page.getByRole('button', { name: 'Connect' }).click(); - await page.getByText('Select Graph...').click(); - await page.getByRole('button', { name: 'Create new Graph...' }).click(); - await page.getByPlaceholder('Graph name').fill('falkorDB'); - await page.getByRole('button', { name: 'Create' }).click(); - await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n').fill('CREATE (:Rider {name:\'Valentino Rossi\'})-[:rides]->(:Team {name:\'Yamaha\'}), (:Rider {name:\'Dani Pedrosa\'})-[:rides]->(:Team {name:\'Honda\'}), (:Rider {name:\'Andrea Dovizioso\'})-[:rides]->(:Team {name:\'Ducati\'})'); - await page.getByRole('button').first().click(); - await page.getByText('falkorDB').click(); -}); \ No newline at end of file diff --git a/e2e/graph.spec.ts b/e2e/graph.spec.ts deleted file mode 100644 index 5d97bf5e..00000000 --- a/e2e/graph.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('http://localhost:3000/login'); - await page.getByRole('button', { name: 'Connect' }).click(); - await page.getByText('Select Graph...').click(); - await page.getByRole('button', { name: 'Create new Graph...' }).click(); - await page.getByPlaceholder('Graph name').fill('falkorDB'); - await page.getByRole('button', { name: 'Create' }).click(); - await page.waitForTimeout(2000) - await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').fill('CREATE (:Rider {name:\'Valentino Rossi\'})-[:rides]->(:Team {name:\'Yamaha\'}), (:Rider {name:\'Dani Pedrosa\'})-[:rides]->(:Team {name:\'Honda\'}), (:Rider {name:\'Andrea Dovizioso\'})-[:rides]->(:Team {name:\'Ducati\'})'); - await page.getByRole('button').first().click(); - await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').click({ clickCount: 3 }); - await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').fill(''); -}); - -test('delete graph', async ({ page }) => { - await page.getByRole('button').nth(1).click(); - await page.getByRole('button', { name: 'Delete graph' }).click(); - await page.getByRole('button', { name: 'Delete' }).click(); - await page.getByText('Select Graph...').click() -}); - -test('tabs navigation', async ({ page }) => { - await page.getByRole('button').first().click(); - await page.getByRole('tab', {name: 'Graph'}).click(); - await page.getByRole('tab', {name: 'Data'}).first().click(); - await page.getByRole('tab', {name: 'Metadata'}).click(); -}); \ No newline at end of file diff --git a/e2e/homePage.spec.ts b/e2e/homePage.spec.ts deleted file mode 100644 index 76cba0ac..00000000 --- a/e2e/homePage.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('http://localhost:3000/'); -}); - -test('connect', async ({ page }) => { - await page.getByRole('button').click(); - await page.waitForURL('http://localhost:3000'); - expect(page.url()).toBe('http://localhost:3000'); - -}); - -test('themes', async ({ page }) => { - await page.getByLabel('system mode').click(); - await page.getByLabel('dark mode').click(); - expect(page.getByLabel('light mode')).toBeVisible(); -}); \ No newline at end of file diff --git a/e2e/login.spec.ts b/e2e/login.spec.ts deleted file mode 100644 index 271f2331..00000000 --- a/e2e/login.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('http://localhost:3000/login'); -}); - -test('login', async ({ page }) => { - await page.getByRole('button', { name: 'Connect' }).click(); - await page.waitForURL("http://localhost:3000/graph"); - expect(page.url()).toBe("http://localhost:3000/graph"); -}); \ No newline at end of file From d6705df5fb67f37090e33cead6c9d387b59284be Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:23:49 +0300 Subject: [PATCH 07/12] create on test --- e2e/login.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 e2e/login.spec.ts diff --git a/e2e/login.spec.ts b/e2e/login.spec.ts new file mode 100644 index 00000000..271f2331 --- /dev/null +++ b/e2e/login.spec.ts @@ -0,0 +1,11 @@ +import { expect, test } from '@playwright/test'; + +test.beforeEach(async ({ page }) => { + await page.goto('http://localhost:3000/login'); +}); + +test('login', async ({ page }) => { + await page.getByRole('button', { name: 'Connect' }).click(); + await page.waitForURL("http://localhost:3000/graph"); + expect(page.url()).toBe("http://localhost:3000/graph"); +}); \ No newline at end of file From ec15dda2a68a584c63451c5abc10b77e74347ea1 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:29:21 +0300 Subject: [PATCH 08/12] adding padding to query section --- app/graph/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/graph/page.tsx b/app/graph/page.tsx index 93e89c08..c21597d2 100644 --- a/app/graph/page.tsx +++ b/app/graph/page.tsx @@ -96,7 +96,7 @@ export default function Page() { return (
{ queryState.current = state }} onDeleteGraph={() => setGraph(Graph.empty())} From e6167020a915deae615822553098369b6c88a0ad Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:19:16 +0300 Subject: [PATCH 09/12] change the function that filters the properties --- app/graph/DataPanel.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/graph/DataPanel.tsx b/app/graph/DataPanel.tsx index 2c528234..86e233db 100644 --- a/app/graph/DataPanel.tsx +++ b/app/graph/DataPanel.tsx @@ -1,6 +1,13 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; +const undisplayedProperties = [ + "category", + "color", + "label", + "source", + "target" +] export default function DataPanel({ node }: { node: Node }) { const rowClass = "dark:hover:bg-slate-700 hover:bg-gray-400 border-y-[1px] border-y-gray-700" @@ -14,12 +21,7 @@ export default function DataPanel({ node }: { node: Node }) { { - Object.entries(node).filter((row) => - Object.values(row)[0] !== "category" - && Object.values(row)[0] !== "color" - && Object.values(row)[0] !== "label" - && Object.values(row)[0] !== "target" - && Object.values(row)[0] !== "source").map((row, index) => ( + Object.entries(node).filter((row) => undisplayedProperties.find(category => row[0] === category) === undefined).map((row, index) => ( // eslint-disable-next-line react/no-array-index-key { From e0ed62bda5baaf14867816854edc13270066fec4 Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:19:16 +0300 Subject: [PATCH 10/12] fix --- app/graph/DataPanel.tsx | 65 +++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/app/graph/DataPanel.tsx b/app/graph/DataPanel.tsx index 2c528234..40e006fa 100644 --- a/app/graph/DataPanel.tsx +++ b/app/graph/DataPanel.tsx @@ -1,6 +1,14 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; +const excludedProperties = new Set([ + "category", + "color", + "label", + "target", + "source" +]); + export default function DataPanel({ node }: { node: Node }) { const rowClass = "dark:hover:bg-slate-700 hover:bg-gray-400 border-y-[1px] border-y-gray-700" @@ -14,38 +22,33 @@ export default function DataPanel({ node }: { node: Node }) { { - Object.entries(node).filter((row) => - Object.values(row)[0] !== "category" - && Object.values(row)[0] !== "color" - && Object.values(row)[0] !== "label" - && Object.values(row)[0] !== "target" - && Object.values(row)[0] !== "source").map((row, index) => ( - // eslint-disable-next-line react/no-array-index-key - - { - Object.values(row).map((cell, cellIndex) => { + Object.entries(node).filter((row) => !excludedProperties.has(row[0])).map((row, index) => ( + // eslint-disable-next-line react/no-array-index-key + + { + Object.values(row).map((cell, cellIndex) => { - const strCell = JSON.stringify(cell) - const text = cellIndex === 1 ? JSON.parse(strCell) : strCell - return ( - // eslint-disable-next-line react/no-array-index-key - - - - - {text} - - -

{text}

-
-
-
-
- ) - }) - } -
- )) + const strCell = JSON.stringify(cell) + const text = cellIndex === 1 ? JSON.parse(strCell) : strCell + return ( + // eslint-disable-next-line react/no-array-index-key + + + + + {text} + + +

{text}

+
+
+
+
+ ) + }) + } +
+ )) }
From 44fe5e75079de3e809eb36967c8e4286f90f0aab Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:23:59 +0300 Subject: [PATCH 11/12] fix --- app/graph/DataPanel.tsx | 61 +++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/app/graph/DataPanel.tsx b/app/graph/DataPanel.tsx index 86e233db..40e006fa 100644 --- a/app/graph/DataPanel.tsx +++ b/app/graph/DataPanel.tsx @@ -1,13 +1,14 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; -const undisplayedProperties = [ +const excludedProperties = new Set([ "category", "color", "label", - "source", - "target" -] + "target", + "source" +]); + export default function DataPanel({ node }: { node: Node }) { const rowClass = "dark:hover:bg-slate-700 hover:bg-gray-400 border-y-[1px] border-y-gray-700" @@ -21,33 +22,33 @@ export default function DataPanel({ node }: { node: Node }) { { - Object.entries(node).filter((row) => undisplayedProperties.find(category => row[0] === category) === undefined).map((row, index) => ( - // eslint-disable-next-line react/no-array-index-key - - { - Object.values(row).map((cell, cellIndex) => { + Object.entries(node).filter((row) => !excludedProperties.has(row[0])).map((row, index) => ( + // eslint-disable-next-line react/no-array-index-key + + { + Object.values(row).map((cell, cellIndex) => { - const strCell = JSON.stringify(cell) - const text = cellIndex === 1 ? JSON.parse(strCell) : strCell - return ( - // eslint-disable-next-line react/no-array-index-key - - - - - {text} - - -

{text}

-
-
-
-
- ) - }) - } -
- )) + const strCell = JSON.stringify(cell) + const text = cellIndex === 1 ? JSON.parse(strCell) : strCell + return ( + // eslint-disable-next-line react/no-array-index-key + + + + + {text} + + +

{text}

+
+
+
+
+ ) + }) + } +
+ )) }
From 5c947d2df4f9fda90dba50fae3806dfbe112f6dd Mon Sep 17 00:00:00 2001 From: Anchel123 <110421452+Anchel123@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:40:58 +0300 Subject: [PATCH 12/12] add graph test --- e2e/graph.spec.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 e2e/graph.spec.ts diff --git a/e2e/graph.spec.ts b/e2e/graph.spec.ts new file mode 100644 index 00000000..1327633c --- /dev/null +++ b/e2e/graph.spec.ts @@ -0,0 +1,29 @@ +import { test } from '@playwright/test'; + +test.beforeEach(async ({ page }) => { + await page.goto('http://localhost:3000/login'); + await page.getByRole('button', { name: 'Connect' }).click(); + await page.getByText('Select Graph...').click(); + await page.getByRole('button', { name: 'Create new Graph...' }).click(); + await page.getByPlaceholder('Graph name').fill('falkorDB'); + await page.getByRole('button', { name: 'Create' }).click(); + await page.waitForTimeout(2000) + await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').fill('CREATE (:Rider {name:\'Valentino Rossi\'})-[:rides]->(:Team {name:\'Yamaha\'}), (:Rider {name:\'Dani Pedrosa\'})-[:rides]->(:Team {name:\'Honda\'}), (:Rider {name:\'Andrea Dovizioso\'})-[:rides]->(:Team {name:\'Ducati\'})'); + await page.getByRole('button').first().click(); + await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').click({ clickCount: 3 }); + await page.getByPlaceholder('MATCH (n) OPTIONAL MATCH (n)').fill(''); +}); + +test('delete graph', async ({ page }) => { + await page.getByRole('button').nth(1).click(); + await page.getByRole('button', { name: 'Delete graph' }).click(); + await page.getByRole('button', { name: 'Delete' }).click(); + await page.getByText('Select Graph...').click() +}); + +test('tabs navigation', async ({ page }) => { + await page.getByRole('button').first().click(); + await page.getByRole('tab', {name: 'Graph'}).click(); + await page.getByRole('tab', {name: 'Data'}).first().click(); + await page.getByRole('tab', {name: 'Metadata'}).click(); +}); \ No newline at end of file