Skip to content

Commit

Permalink
Merge pull request #162 from FalkorDB/e2e
Browse files Browse the repository at this point in the history
fix #141 e2e
  • Loading branch information
AviAvni authored Apr 9, 2024
2 parents 4915093 + 06f1fb0 commit 5515b38
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 21 deletions.
13 changes: 13 additions & 0 deletions e2e/createGraph.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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").first().click()
});
29 changes: 29 additions & 0 deletions e2e/graph.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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();
});
18 changes: 18 additions & 0 deletions e2e/homePage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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/login');
expect(page.url()).toBe('http://localhost:3000/login');

});

test('themes', async ({ page }) => {
await page.getByLabel('system mode').click();
await page.getByLabel('dark mode').click();
expect(page.getByLabel('light mode')).toBeVisible();
});
11 changes: 5 additions & 6 deletions e2e/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';

test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:3000/');
await page.goto('http://localhost:3000/login');
});

test('connect', async ({ page }) => {
test('login', async ({ page }) => {
await page.getByRole('button', { name: 'Connect' }).click();
await page.getByRole('button', { name: 'Connect' }).click();

await page.getByText('Select Graph...').click();
await page.waitForURL("http://localhost:3000/graph");
expect(page.url()).toBe("http://localhost:3000/graph");
});
15 changes: 0 additions & 15 deletions e2e/simple.spec.ts

This file was deleted.

0 comments on commit 5515b38

Please sign in to comment.