mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 15:16:14 +00:00
Migrate from Cypress to Playwright
This commit is contained in:
32
playwright.config.ts
Normal file
32
playwright.config.ts
Normal 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',
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user