👽 Configures frontend tests suit

This commit is contained in:
Rune Harlyk
2024-05-03 15:42:52 +02:00
committed by Rune Harlyk
parent 00381579db
commit 2b4d196e7c
14 changed files with 349 additions and 102 deletions
+24
View File
@@ -0,0 +1,24 @@
import { expect, test } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/');
await page.route('**/api/features', (route) =>
route.fulfill({
status: 200,
body: JSON.stringify({})
})
);
await expect(page).toHaveTitle(/Spot micro controller/);
});
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await page.route('**/api/features', (route) =>
route.fulfill({
status: 200,
body: JSON.stringify({})
})
);
await expect(page.getByRole('heading', { name: 'Spot micro controller' }).first()).toBeVisible();
});