|
1 | | -import { defineConfig, devices } from "@playwright/test"; |
2 | | -import type nodeProcess from "node:process"; |
| 1 | +import { configurePlaywright } from "../../common/config-e2e"; |
3 | 2 |
|
4 | | -declare const process: typeof nodeProcess; |
5 | | - |
6 | | -/** |
7 | | - * See https://playwright.dev/docs/test-configuration. |
8 | | - */ |
9 | | -export default defineConfig({ |
10 | | - testDir: "./", |
11 | | - testIgnore: "cloudflare.spec.ts", |
12 | | - /* Run tests in files in parallel */ |
13 | | - fullyParallel: true, |
14 | | - /* Fail the build on CI if you accidentally left test.only in the source code. */ |
15 | | - forbidOnly: !!process.env.CI, |
16 | | - /* Retry on CI only */ |
17 | | - retries: process.env.CI ? 2 : 0, |
18 | | - /* Opt out of parallel tests on CI. */ |
19 | | - workers: process.env.CI ? 1 : undefined, |
20 | | - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
21 | | - reporter: "html", |
22 | | - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
23 | | - use: { |
24 | | - /* Base URL to use in actions like `await page.goto('/')`. */ |
25 | | - baseURL: "http://localhost:3333", |
26 | | - |
27 | | - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
28 | | - trace: "on-first-retry", |
29 | | - }, |
30 | | - |
31 | | - /* Configure projects for major browsers */ |
32 | | - projects: [ |
33 | | - { |
34 | | - name: "chromium", |
35 | | - use: { ...devices["Desktop Chrome"] }, |
36 | | - }, |
37 | | - |
38 | | - { |
39 | | - name: "firefox", |
40 | | - use: { ...devices["Desktop Firefox"] }, |
41 | | - }, |
42 | | - |
43 | | - { |
44 | | - name: "webkit", |
45 | | - use: { ...devices["Desktop Safari"] }, |
46 | | - }, |
47 | | - ], |
48 | | - |
49 | | - /* Run your local dev server before starting the tests */ |
50 | | - webServer: { |
51 | | - command: "pnpm dev --port 3333", |
52 | | - url: "http://localhost:3333", |
53 | | - reuseExistingServer: !process.env.CI, |
54 | | - }, |
| 3 | +export default configurePlaywright("api", { |
| 4 | + isCI: !!process.env.CI, |
| 5 | + isWorker: false, |
| 6 | + multipleBrowsers: false, |
55 | 7 | }); |
0 commit comments