Skip to content

Commit 4621f73

Browse files
committed
Create Categories.spec.ts
1 parent 639f604 commit 4621f73

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Categories', () => {
4+
test('should navigate to categories page and verify content', async ({ page }) => {
5+
// Start from homepage
6+
await page.goto('http://localhost:3000/');
7+
8+
// Click on Categories link in navigation
9+
await page.getByRole('link', { name: 'KATEGORIER' }).click();
10+
11+
// Verify URL
12+
await expect(page).toHaveURL('http://localhost:3000/kategorier');
13+
14+
// Verify page title
15+
await expect(page.locator('h1')).toContainText('Kategorier');
16+
17+
// Verify categories section exists
18+
await expect(page.locator('section')).toBeVisible();
19+
});
20+
21+
test('should navigate back to home from categories', async ({ page }) => {
22+
// Start from categories page
23+
await page.goto('http://localhost:3000/kategorier');
24+
25+
// Click on home/logo link
26+
await page.getByRole('link', { name: 'NETTBUTIKK' }).click();
27+
28+
// Verify we're back on homepage
29+
await expect(page).toHaveURL('http://localhost:3000/');
30+
});
31+
});

0 commit comments

Comments
 (0)