|
| 1 | +import { defineConfig, devices } from '@playwright/test'; |
| 2 | + |
| 3 | +const DEFAULT_EXPECT_TIMEOUT = process.env.CI ? 30000 : 120000; |
| 4 | +const DEFAULT_TEST_TIMEOUT = process.env.CI ? 60000 : 240000; |
| 5 | + |
| 6 | +const headless = !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS; |
| 7 | + |
| 8 | +export default defineConfig({ |
| 9 | + forbidOnly: !!process.env.CI, |
| 10 | + retries: process.env.CI ? 2 : 0, |
| 11 | + workers: process.env.CI ? 1 : undefined, |
| 12 | + timeout: DEFAULT_TEST_TIMEOUT, |
| 13 | + fullyParallel: true, |
| 14 | + reporter: [ |
| 15 | + ['list'], |
| 16 | + ['html', { outputFolder: './test-results/reports/playwright-html-report', open: 'never' }], |
| 17 | + ], |
| 18 | + outputDir: './test-results/results', |
| 19 | + use: { |
| 20 | + baseURL: 'http://localhost:4322', |
| 21 | + locale: 'en-US', |
| 22 | + trace: 'retain-on-failure', |
| 23 | + headless, |
| 24 | + }, |
| 25 | + projects: [ |
| 26 | + { |
| 27 | + name: '@calcom/base', |
| 28 | + testDir: './tests', |
| 29 | + testMatch: /.*\.e2e\.tsx?/, |
| 30 | + expect: { |
| 31 | + timeout: DEFAULT_EXPECT_TIMEOUT, |
| 32 | + }, |
| 33 | + use: { |
| 34 | + ...devices['Desktop Chrome'], |
| 35 | + locale: 'en-US', |
| 36 | + }, |
| 37 | + }, |
| 38 | + ], |
| 39 | + webServer: { |
| 40 | + command: process.env.CI |
| 41 | + ? `yarn workspace @calcom/atoms dev-on && yarn workspace @calcom/atoms build && rm -f prisma/dev.db && yarn prisma db push && NEXT_PUBLIC_IS_E2E=1 NODE_ENV=test NEXT_PUBLIC_X_CAL_ID="${process.env.ATOMS_E2E_OAUTH_CLIENT_ID}" X_CAL_SECRET_KEY="${process.env.ATOMS_E2E_OAUTH_CLIENT_SECRET}" NEXT_PUBLIC_CALCOM_API_URL="${process.env.ATOMS_E2E_API_URL}" VITE_BOOKER_EMBED_OAUTH_CLIENT_ID="${process.env.ATOMS_E2E_OAUTH_CLIENT_ID_BOOKER_EMBED}" VITE_BOOKER_EMBED_API_URL="${process.env.ATOMS_E2E_API_URL}" ORGANIZATION_ID=${process.env.ATOMS_E2E_ORG_ID} yarn dev:e2e` |
| 42 | + : `rm -f prisma/dev.db && yarn prisma db push && yarn dev:e2e`, |
| 43 | + url: 'http://localhost:4322', |
| 44 | + timeout: 600_000, |
| 45 | + reuseExistingServer: !process.env.CI, |
| 46 | + }, |
| 47 | +}); |
0 commit comments