1 | module.exports = async function (config) {
|
2 | const {installBrowsersForNpmInstall, registry} = require('playwright-core/lib/server');
|
3 | await installBrowsersForNpmInstall(['firefox', 'chromium']);
|
4 | process.env.FIREFOX_BIN = registry.findExecutable('firefox').executablePath();
|
5 | process.env.CHROMIUM_BIN = registry.findExecutable('chromium').executablePath();
|
6 |
|
7 | config.set({
|
8 | basePath: 'dist',
|
9 | frameworks: ['mocha', 'source-map-support'],
|
10 | client: {
|
11 | mocha: {
|
12 | ui: 'tdd',
|
13 | timeout: 2000 * (process.env.CI === undefined ? 1 : 10),
|
14 | },
|
15 | },
|
16 | files: [
|
17 | {pattern: './*.js', included: true, watched: true, served: true, type: 'module'},
|
18 |
|
19 | {pattern: './**/*', included: false, watched: true, served: true, nocache: true},
|
20 | ],
|
21 | autoWatch: true,
|
22 | browsers: ['ChromiumHeadlessNoSandbox', 'FirefoxHeadless'],
|
23 | customLaunchers: {
|
24 | ChromiumHeadlessNoSandbox: {
|
25 | base: 'ChromiumHeadless',
|
26 | flags: ['--no-sandbox'],
|
27 | },
|
28 | },
|
29 | singleRun: false,
|
30 | logLevel: config.LOG_ERROR,
|
31 | });
|
32 | };
|