mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 02:06:36 +00:00
40 lines
928 B
TypeScript
40 lines
928 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
import dotenv from 'dotenv';
|
|
|
|
if (!process.env.CI) {
|
|
dotenv.config({ path: '.env.local' });
|
|
}
|
|
|
|
const port = 5175;
|
|
const usePreviewUrl = !!process.env.PLAYWRIGHT_TEST_BASE_URL;
|
|
const baseURL = usePreviewUrl ? process.env.PLAYWRIGHT_TEST_BASE_URL : `http://localhost:${port}`;
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: 1,
|
|
reporter: 'html',
|
|
timeout: 60000, // Increase global timeout to 60 seconds
|
|
use: {
|
|
baseURL,
|
|
trace: 'on',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
webServer: usePreviewUrl
|
|
? undefined
|
|
: {
|
|
command: `pnpm dev --port ${port}`,
|
|
port,
|
|
timeout: 120000, // 2 minutes
|
|
stdout: 'pipe',
|
|
stderr: 'pipe',
|
|
},
|
|
});
|