[MM-49724] More robust check for startup before starting E2E tests (#2504)

* [MM-49724] More robust check for startup before starting E2E tests

* Fix a few more tests
This commit is contained in:
Devin Binnie
2023-01-18 05:11:11 -05:00
committed by GitHub
parent 7d79cab916
commit c8c88a274f
4 changed files with 27 additions and 11 deletions

View File

@@ -214,16 +214,16 @@ module.exports = {
// // this changes the default debugging port so chromedriver can run without issues.
// options.chromeDriverArgs.push('remote-debugging-port=9222');
//}
return electron.launch(options).then(async (app) => {
// Make sure the app has time to fully load and that the window is focused
await asyncSleep(1000);
const mainWindow = app.windows().find((window) => window.url().includes('index'));
const browserWindow = await app.browserWindow(mainWindow);
await browserWindow.evaluate((win) => {
win.show();
return true;
return electron.launch(options).then(async (eapp) => {
await eapp.evaluate(async ({app}) => {
const promise = new Promise((resolve) => {
app.on('e2e-app-loaded', () => {
resolve();
});
});
return promise;
});
return app;
return eapp;
});
},