File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments