Files
main_frontend/playwright.config.ts
2026-04-04 14:51:40 +03:00

59 lines
1.3 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test"
import {
FRONTEND_INTEGRATION_PORT,
FRONTEND_INTEGRATION_URL,
FRONTEND_MOCK_PORT,
FRONTEND_MOCK_URL,
MOCK_API_URL,
} from "./tests/e2e/support/config"
export default defineConfig({
testDir: "./tests/e2e/specs",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: "html",
use: {
actionTimeout: 10_000,
screenshot: "only-on-failure",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
testIgnore: /\.integration\./,
use: {
...devices["Desktop Chrome"],
baseURL: FRONTEND_MOCK_URL,
},
},
{
name: "integration",
testMatch: /\.integration\./,
use: {
...devices["Desktop Chrome"],
baseURL: FRONTEND_INTEGRATION_URL,
},
},
],
webServer: [
{
command: "bun --bun tests/e2e/support/mock-api.ts",
url: `${MOCK_API_URL}/api/ping/`,
reuseExistingServer: !process.env.CI,
},
{
command: `NEXT_PUBLIC_API_URL=${MOCK_API_URL} NEXT_TEST_DIR=.next-test bun dev --port ${FRONTEND_MOCK_PORT}`,
url: FRONTEND_MOCK_URL,
reuseExistingServer: !process.env.CI,
},
{
command: `bun dev --port ${FRONTEND_INTEGRATION_PORT}`,
url: FRONTEND_INTEGRATION_URL,
reuseExistingServer: true,
},
],
})