forked from webdriverio-community/wdio-electron-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwdio.conf.js
43 lines (39 loc) · 1.29 KB
/
wdio.conf.js
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
import url from 'node:url';
import path from 'node:path';
import fs from 'node:fs';
import { getAppBuildInfo, getBinaryPath, getElectronVersion } from '@wdio/electron-utils';
const exampleDir = process.env.EXAMPLE_DIR || 'forge-esm';
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const packageJsonPath = path.join(__dirname, '..', 'apps', exampleDir, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
const pkg = { packageJson, path: packageJsonPath };
const electronVersion = getElectronVersion(pkg);
const appBuildInfo = await getAppBuildInfo(pkg);
const appBinaryPath = await getBinaryPath(packageJsonPath, appBuildInfo, electronVersion);
globalThis.packageJson = packageJson;
process.env.TEST = 'true';
export const config = {
services: ['electron'],
capabilities: [
{
'browserName': 'electron',
'wdio:electronServiceOptions': {
appBinaryPath,
appArgs: ['foo', 'bar=baz'],
restoreMocks: true,
},
},
],
waitforTimeout: 5000,
connectionRetryCount: 10,
connectionRetryTimeout: 30000,
logLevel: 'debug',
runner: 'local',
outputDir: `wdio-logs-${exampleDir}`,
specs: ['./js/*.spec.js'],
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 30000,
},
};