feat: Add e2e setup and tests (#535)

This commit is contained in:
Jovan Milosevic
2025-02-12 08:57:18 +01:00
committed by GitHub
parent e00dad9200
commit 6794ab20d3
19 changed files with 366 additions and 42 deletions
+23
View File
@@ -0,0 +1,23 @@
import { test, expect } from '@playwright/test'
test('it renders index page', async ({ page }) => {
await page.goto('/')
const header = await page.textContent('h1')
const subtitle = await page.textContent('h2')
expect(header).toContain('TUONO')
expect(subtitle).toContain('Subtitle received from the server')
})
test('it renders second route', async ({ page }) => {
await page.goto('/second-route')
const header = await page.textContent('h1')
expect(header).toContain('Second route')
})
test('it routes to second route on link click', async ({ page }) => {
await page.goto('/')
await page.click('text=Routing link')
await page.waitForURL('/second-route')
const header = await page.textContent('h1')
expect(header).toContain('Second route')
})