-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb-test-runner.config.js
More file actions
51 lines (47 loc) · 1.4 KB
/
web-test-runner.config.js
File metadata and controls
51 lines (47 loc) · 1.4 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
45
46
47
48
49
50
51
import process from 'node:process';
import {playwrightLauncher} from '@web/test-runner-playwright';
import {installBrowsersForNpmInstall, registry} from 'playwright-core/lib/server';
async function setup() {
const browsersToInstall = [];
if (!process.env.FIREFOX_BIN) {
browsersToInstall.push('firefox');
}
if (!process.env.CHROMIUM_BIN) {
browsersToInstall.push('chromium');
}
if (browsersToInstall.length > 0) {
await installBrowsersForNpmInstall(browsersToInstall);
}
if (!process.env.FIREFOX_BIN) {
process.env.FIREFOX_BIN = registry.findExecutable('firefox').executablePath();
}
if (!process.env.CHROMIUM_BIN) {
process.env.CHROMIUM_BIN = registry.findExecutable('chromium').executablePath();
}
}
await setup();
export default {
files: 'dist/*.js',
testFramework: {
config: {
ui: 'tdd',
timeout: 2000 * (process.env.CI === undefined ? 1 : 10),
},
},
browsers: [
playwrightLauncher({
product: 'firefox',
launchOptions: {
executablePath: process.env.FIREFOX_BIN,
headless: true,
},
}),
playwrightLauncher({
product: 'chromium',
launchOptions: {
executablePath: process.env.CHROMIUM_BIN,
headless: true,
},
}),
],
};