()
| 61 | } |
| 62 | |
| 63 | public async start(): Promise<void> { |
| 64 | try { |
| 65 | // launch the electron processs |
| 66 | this.#privApp = await electron.launch({ |
| 67 | executablePath: this.#options.main, |
| 68 | args: this.#options.args.slice(), |
| 69 | env: { |
| 70 | ...process.env, |
| 71 | MOCK_TEST: 'true', |
| 72 | SIGNAL_CI_CONFIG: this.#options.config, |
| 73 | }, |
| 74 | locale: 'en', |
| 75 | timeout: 30 * SECOND, |
| 76 | }); |
| 77 | |
| 78 | // wait for the first window to load |
| 79 | await pTimeout( |
| 80 | (async () => { |
| 81 | const page = await this.getWindow(); |
| 82 | if (process.env.TRACING) { |
| 83 | await page.context().tracing.start({ |
| 84 | name: 'tracing', |
| 85 | screenshots: true, |
| 86 | snapshots: true, |
| 87 | }); |
| 88 | } |
| 89 | await page?.emulateMedia({ reducedMotion: 'reduce' }); |
| 90 | await page?.waitForLoadState('load'); |
| 91 | })(), |
| 92 | { milliseconds: 20 * SECOND } |
| 93 | ); |
| 94 | } catch (e) { |
| 95 | this.#privApp?.process().kill('SIGKILL'); |
| 96 | throw e; |
| 97 | } |
| 98 | |
| 99 | this.#privApp.on('close', () => this.emit('close')); |
| 100 | |
| 101 | drop(this.#printLoop()); |
| 102 | } |
| 103 | |
| 104 | public async waitForProvisionURL(): Promise<string> { |
| 105 | return this.#waitForEvent('provisioning-url'); |
no test coverage detected