/
wdio.conf.ts
40 lines (35 loc) · 984 Bytes
/
wdio.conf.ts
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
import os from 'os'
import path from 'path'
import { spawn, ChildProcess } from 'child_process'
let tauriDriver: ChildProcess
const application =
process.env.E2E_APPLICATION || `./src-tauri/target/release/zoo-modeling-app`
export const config = {
port: 4444,
specs: ['./e2e/tauri/specs/**/*.ts'],
maxInstances: 1,
capabilities: [
{
maxInstances: 1,
'tauri:options': {
application,
},
},
],
reporters: ['spec'],
framework: 'mocha',
mochaOpts: {
bail: true,
ui: 'bdd',
timeout: 600000,
},
// ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests
beforeSession: () =>
(tauriDriver = spawn(
path.resolve(os.homedir(), '.cargo', 'bin', 'tauri-driver'),
[],
{ stdio: [null, process.stdout, process.stderr] }
)),
// clean up the `tauri-driver` process we spawned at the start of the session
afterSession: () => tauriDriver.kill(),
}