cms.c2sgmbh/tests/e2e/frontend.e2e.spec.ts
Martin Porwoll a88e4f60d0 test: add E2E and integration tests with documentation
Tests:
- Update frontend.e2e.spec.ts with locale testing
- Add search.e2e.spec.ts for search functionality
- Add i18n.int.spec.ts for localization tests
- Add search.int.spec.ts for search integration
- Update playwright.config.ts

Documentation:
- Add CLAUDE.md with project instructions
- Add docs/ directory with detailed documentation
- Add scripts/ for utility scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 08:19:52 +00:00

38 lines
1.1 KiB
TypeScript

import { test, expect, Page } from '@playwright/test'
test.describe('Frontend', () => {
let page: Page
test.beforeAll(async ({ browser }, testInfo) => {
const context = await browser.newContext()
page = await context.newPage()
})
test('can go on homepage (default locale redirect)', async ({ page }) => {
// Root redirects to default locale /de
await page.goto('/')
// Title should contain "Payload CMS" (from localized SiteSettings or default)
await expect(page).toHaveTitle(/Payload/)
// Check page loaded successfully (status 200)
const response = await page.goto('/')
expect(response?.status()).toBeLessThan(400)
})
test('can access German locale page', async ({ page }) => {
await page.goto('/de')
// Should load without error
const response = await page.goto('/de')
expect(response?.status()).toBeLessThan(400)
})
test('can access English locale page', async ({ page }) => {
await page.goto('/en')
// Should load without error
const response = await page.goto('/en')
expect(response?.status()).toBeLessThan(400)
})
})