playwright.config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { defineConfig, devices } from '@playwright/test'
  2. /**
  3. * Read environment variables from file.
  4. * https://github.com/motdotla/dotenv
  5. */
  6. import 'dotenv/config'
  7. /**
  8. * See https://playwright.dev/docs/test-configuration.
  9. */
  10. export default defineConfig({
  11. testDir: './tests/e2e',
  12. /* Fail the build on CI if you accidentally left test.only in the source code. */
  13. forbidOnly: !!process.env.CI,
  14. /* Retry on CI only */
  15. retries: process.env.CI ? 2 : 0,
  16. /* Opt out of parallel tests on CI. */
  17. workers: process.env.CI ? 1 : undefined,
  18. /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  19. reporter: 'html',
  20. /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  21. use: {
  22. /* Base URL to use in actions like `await page.goto('/')`. */
  23. // baseURL: 'http://localhost:3000',
  24. /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
  25. trace: 'on-first-retry',
  26. },
  27. projects: [
  28. {
  29. name: 'chromium',
  30. use: { ...devices['Desktop Chrome'], channel: 'chromium' },
  31. },
  32. ],
  33. webServer: {
  34. command: 'pnpm dev',
  35. reuseExistingServer: true,
  36. url: 'http://localhost:3000',
  37. },
  38. })