-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
44 lines (39 loc) · 1.29 KB
/
playwright.config.ts
File metadata and controls
44 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
import path from 'path';
import { getDevServerDetails, hasDevServerPortEnvVar } from './tests/utils';
const testsDotEnvPath = '.tests/.env';
dotenv.config({
path: path.resolve(__dirname, testsDotEnvPath),
});
if (!hasDevServerPortEnvVar()) {
console.error(`👹 Oops! Expected the environment variable NEXT_DEV_SERVER_envPort to have a valid envPort number but got ${process.env.NEXT_DEV_SERVER_PORT}, which type is ${typeof process.env.NEXT_DEV_SERVER_PORT}`);
process.exit(1);
}
const { url } = getDevServerDetails();
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 0,
// On CI/CD runners, low specs cause inconsistent runs
// To mitigate any inconsistency playwright's team
// recommends running in a single worker
// https://playwright.dev/docs/ci//workers
// Note: That launching a `macos-latest-xlarge`
// is more efficient but increases cost dramatically
workers: process.env.CI ? 1 : undefined,
reporter: 'list',
use: {
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});