Test the complete login flow from browser perspective using Playwright.
1 import { defineConfig, devices } from '@playwright/test'; 2 3 export default defineConfig({ 4 testDir: './tests/e2e', 5 fullyParallel: true, 6 retries: process.env.CI ? 2 : 0, 7 use: { 8 baseURL: 'http://localhost:3000', 9 trace: 'on-first-retry', 10 }, 11 projects: [ 12 { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, 13 { name: 'firefox', use: { ...devices['Desktop Firefox'] } }, 14 ], 15 webServer: { 16 command: 'npm run dev', 17 url: 'http://localhost:3000', 18 reuseExistingServer: !process.env.CI, 19 }, 20 });
Login form tests pass: success redirects, failure shows error, keyboard works
Sign in to share your feedback and join the discussion.