cal.pub0.org/jest.playwright.config.js

35 lines
959 B
JavaScript
Raw Permalink Normal View History

const opts = {
// launch headless on CI, in browser locally
headless: !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS,
2021-11-02 14:19:40 +00:00
collectCoverage: false, // not possible in Next.js 12
executablePath: process.env.PLAYWRIGHT_CHROME_EXECUTABLE_PATH,
};
console.log("⚙️ Playwright options:", JSON.stringify(opts, null, 4));
2021-10-07 15:07:57 +00:00
module.exports = {
verbose: true,
preset: "jest-playwright-preset",
transform: {
"^.+\\.ts$": "ts-jest",
},
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,
2021-11-03 14:02:17 +00:00
launchType: "LAUNCH",
2021-10-07 15:07:57 +00:00
launchOptions: {
headless: opts.headless,
executablePath: opts.executablePath,
2021-10-07 15:07:57 +00:00
},
contextOptions: {
recordVideo: {
dir: "playwright/videos",
2021-10-07 15:07:57 +00:00
},
},
collectCoverage: opts.collectCoverage,
2021-10-07 15:07:57 +00:00
},
},
};