Migrate from Cypress to Playwright

This commit is contained in:
Przemek Więch
2026-05-06 11:51:30 +02:00
parent 664ca69fb3
commit d427300ddf
28 changed files with 740 additions and 1403 deletions

32
playwright.config.ts Normal file
View File

@@ -0,0 +1,32 @@
import {defineConfig, devices} from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? '100%' : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
locale: 'en-US', // Forces consistent translation keys across locales for robust placeholder selectors
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
webServer: {
command: process.env.CI
? 'npx vite preview --port 3000 --strictPort' // CI already builds the app; preview directly with strict port
: 'npx vite --no-open --port 3000 --strictPort',
port: 3000,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
},
});