2021-10-13 13:26:56 +00:00
|
|
|
const opts = {
|
|
|
|
// launch headless on CI, in browser locally
|
|
|
|
headless: !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS,
|
|
|
|
collectCoverage: !!process.env.PLAYWRIGHT_HEADLESS,
|
2021-10-17 00:11:37 +00:00
|
|
|
executablePath: process.env.PLAYWRIGHT_CHROME_EXECUTABLE_PATH,
|
2021-10-13 13:26:56 +00:00
|
|
|
};
|
|
|
|
|
2021-10-18 21:07:06 +00:00
|
|
|
console.log("⚙️ Playwright options:", JSON.stringify(opts, null, 4));
|
2021-10-13 13:26:56 +00:00
|
|
|
|
2021-10-07 15:07:57 +00:00
|
|
|
module.exports = {
|
|
|
|
verbose: true,
|
|
|
|
preset: "jest-playwright-preset",
|
|
|
|
transform: {
|
|
|
|
"^.+\\.ts$": "ts-jest",
|
|
|
|
},
|
2021-10-18 21:07:06 +00:00
|
|
|
testMatch: ["<rootDir>/playwright/**/*(*.)@(spec|test).[jt]s?(x)"],
|
2021-10-07 15:07:57 +00:00
|
|
|
testEnvironmentOptions: {
|
|
|
|
"jest-playwright": {
|
|
|
|
browsers: ["chromium" /*, 'firefox', 'webkit'*/],
|
|
|
|
exitOnPageError: false,
|
|
|
|
launchOptions: {
|
2021-10-13 13:26:56 +00:00
|
|
|
headless: opts.headless,
|
|
|
|
executablePath: opts.executablePath,
|
2021-10-07 15:07:57 +00:00
|
|
|
},
|
|
|
|
contextOptions: {
|
|
|
|
recordVideo: {
|
2021-10-13 13:26:56 +00:00
|
|
|
dir: "playwright/videos",
|
2021-10-07 15:07:57 +00:00
|
|
|
},
|
|
|
|
},
|
2021-10-13 13:26:56 +00:00
|
|
|
collectCoverage: opts.collectCoverage,
|
2021-10-07 15:07:57 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|