Commit 1bff5b04 authored by Tasso Evangelista's avatar Tasso Evangelista

Fetch and print app logs in e2e tests

parent cdb3c70a
......@@ -3,6 +3,7 @@ import electron from 'electron';
import { Application } from 'spectron';
export let app = null;
let logFetchInterval = null;
export async function startApp () {
this.timeout(10000);
......@@ -18,15 +19,22 @@ export async function startApp () {
await app.start();
await app.client.waitUntilWindowLoaded();
logFetchInterval = setInterval(fetchLogs, 100);
};
export async function stopApp () {
this.timeout(10000);
if (app && app.isRunning()) {
const logs = await app.client.getMainProcessLogs();
logs.forEach(log => console.log(log));
clearInterval(logFetchInterval);
fetchLogs();
await app.stop();
app = null;
}
};
const fetchLogs = async () => {
const logs = await app.client.getMainProcessLogs();
logs.forEach(log => console.log(log));
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment