playwright.config.ts 758 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig, devices } from '@playwright/test'
  2. const isDebug = !!process.env.PWDEBUG || !!process.env.DEBUG
  3. export default defineConfig({
  4. testDir: './tests/e2e',
  5. fullyParallel: isDebug ? false : true,
  6. forbidOnly: !!process.env.CI,
  7. retries: process.env.CI ? 2 : 0,
  8. workers: process.env.CI ? 1 : isDebug ? 1 : undefined,
  9. reporter: 'html',
  10. use: {
  11. baseURL: 'http://localhost:3000',
  12. trace: 'on-first-retry',
  13. screenshot: 'only-on-failure',
  14. video: 'retain-on-failure'
  15. },
  16. projects: [
  17. {
  18. name: 'chromium',
  19. use: { ...devices['Desktop Chrome'] }
  20. }
  21. ],
  22. webServer: {
  23. command: 'pnpm run dev',
  24. url: 'http://localhost:3000',
  25. reuseExistingServer: !process.env.CI,
  26. timeout: 120 * 1000
  27. }
  28. })