diff --git a/playwright.config.ts b/playwright.config.ts index 5c4e37820..28b3d59e8 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,9 +1,9 @@ -import { devices, type PlaywrightTestConfig } from '@playwright/test' +import { defineConfig, devices } from '@playwright/test' import 'dotenv/config' const PORT = process.env.PORT || '3000' -export default { +export default defineConfig({ testDir: './tests/e2e', timeout: 15 * 1000, expect: { @@ -15,7 +15,6 @@ export default { workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { - actionTimeout: 0, baseURL: `http://localhost:${PORT}/`, trace: 'on-first-retry', }, @@ -30,12 +29,13 @@ export default { ], webServer: { - command: process.env.CI - ? `cross-env PORT=${PORT} npm run start:mocks` - : `cross-env PORT=${PORT} npm run dev`, + command: process.env.CI ? 'npm run start:mocks' : 'npm run dev', port: Number(PORT), - reuseExistingServer: true, + reuseExistingServer: !process.env.CI, stdout: 'pipe', stderr: 'pipe', + env: { + PORT, + }, }, -} satisfies PlaywrightTestConfig +}) diff --git a/tests/playwright-utils.ts b/tests/playwright-utils.ts index e56feaf2c..a94e3b4af 100644 --- a/tests/playwright-utils.ts +++ b/tests/playwright-utils.ts @@ -35,7 +35,7 @@ export const test = base.extend<{ }>({ login: [ async ({ page, baseURL }, use) => { - use(user => loginPage({ page, baseURL, user })) + await use(user => loginPage({ page, baseURL, user })) }, { auto: true }, ],