Add the frontend login page (LoginPage.vue) with email and password fields, Swedish UI strings, and integration with the backend login endpoint. Also sets up Playwright as the E2E testing framework with browser tests for both login and registration flows. Frontend login implementation: - Add LoginPage.vue with form validation, error handling, and link to registration page - Add login() API function in auth.ts - Add loginUser() method to authStore that stores JWT token - Add /logga-in route to Vue Router - Add 'Logga in' nav link to AppHeader alongside existing 'Registrera' - Add 10 unit tests for LoginPage component - Add 4 unit tests for loginUser auth store method - Add 1 route resolution test and 1 AppHeader link test Playwright E2E setup and tests: - Install @playwright/test and configure playwright.config.ts - Add npm scripts: test:e2e (local) and test:e2e:ci (Docker CI) - Exclude e2e/ directory from Vitest to prevent test runner conflicts - Add .gitignore entries for test-results/ and playwright-report/ - Add 5 E2E tests for login (navigation, invalid credentials, success redirect, navigation to register, input types) - Add 6 E2E tests for register (navigation, success redirect, validation errors for invalid email/short password/mismatched passwords, navigation to login)
29 lines
576 B
TypeScript
29 lines
576 B
TypeScript
import { defineConfig } from '@playwright/test'
|
|
|
|
const isCI = !!process.env.PLAYWRIGHT_BASE_URL
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
timeout: 30_000,
|
|
retries: 0,
|
|
use: {
|
|
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:3000',
|
|
headless: true,
|
|
},
|
|
...(isCI
|
|
? {}
|
|
: {
|
|
webServer: {
|
|
command: 'npm run dev',
|
|
port: 3000,
|
|
reuseExistingServer: true,
|
|
timeout: 30_000,
|
|
},
|
|
}),
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { browserName: 'chromium' },
|
|
},
|
|
],
|
|
})
|