Add Playwright E2E tests with MSW API mocking
- Playwright + @msw/playwright + @msw/source for OpenAPI-driven mocks - Chromium-only configuration with Vite dev server integration - Smoke tests: home page, CTA, navigation - US-1 tests: validation, event creation flow, localStorage, error handling - Suppress Node 25 --localstorage-file warning from MSW cookieStore
This commit is contained in:
20
frontend/e2e/smoke.spec.ts
Normal file
20
frontend/e2e/smoke.spec.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { test, expect } from './msw-setup'
|
||||
|
||||
test.describe('Smoke', () => {
|
||||
test('home page loads and shows branding', async ({ page }) => {
|
||||
await page.goto('/')
|
||||
await expect(page.getByRole('heading', { name: 'fete' })).toBeVisible()
|
||||
})
|
||||
|
||||
test('home page has create event CTA', async ({ page }) => {
|
||||
await page.goto('/')
|
||||
await expect(page.getByRole('link', { name: /create event/i })).toBeVisible()
|
||||
})
|
||||
|
||||
test('navigating to /create shows the creation form', async ({ page }) => {
|
||||
await page.goto('/')
|
||||
await page.getByRole('link', { name: /create event/i }).click()
|
||||
await expect(page).toHaveURL('/create')
|
||||
await expect(page.getByLabel(/title/i)).toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user