diff --git a/e2e-tests/helpers/electron.helpers.ts b/e2e-tests/helpers/electron.helpers.ts index 1b814126..0b6363bb 100644 --- a/e2e-tests/helpers/electron.helpers.ts +++ b/e2e-tests/helpers/electron.helpers.ts @@ -18,30 +18,27 @@ export async function startApp(): Promise { const appInfo = parseElectronApp(latestBuild); const electronApp = await electron.launch({ args: [appInfo.main], + env: { + ...process.env, + E2E_BUILD: "true", + }, executablePath: appInfo.executable, recordVideo: { dir: getRecordingPath(appInfo.platform), size: { - width: 1920, - height: 1080, + width: 1200, + height: 800, }, }, }); - await electronApp.firstWindow(); - - // wait for auto-updater to pass - let appWindow: Page; - while (!appWindow) { - appWindow = getMainWindow(electronApp.windows()); - await pause(500); - } + const appWindow = await electronApp.firstWindow(); if (!appWindow) { throw new Error('Unable to get main window'); } - await pause(4000); + await pause(3000); appWindow.on('console', log.info); appWindow.screenshot({path: path.join(TEST_OUTPUT_DIR, "initial-screen.png")}); diff --git a/e2e-tests/main.test.ts b/e2e-tests/main.test.ts index 38c07f33..fab98a51 100644 --- a/e2e-tests/main.test.ts +++ b/e2e-tests/main.test.ts @@ -37,7 +37,7 @@ test('should be able to select then unselect a bs version', async () => { expect(await addVersionPanel.downloadVersionButton.isVisible()).toBeTruthy(); await addVersionPanel.clickVersion(versionManifest); // deselect version 0.12.2 - await pause(2000); + await pause(3000); expect(await addVersionPanel.downloadVersionButton.isVisible()).toBeFalsy(); diff --git a/src/main/main.ts b/src/main/main.ts index 4a68b148..4fd919f0 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -22,6 +22,7 @@ import { IpcRequest } from "shared/models/ipc"; import { LivShortcut } from "./services/liv/liv-shortcut.service"; const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true"; +const isE2E = process.env.E2E_BUILD === "true"; log.transports.file.level = "info"; log.transports.file.resolvePath = () => { @@ -53,7 +54,7 @@ const installExtensions = async () => { .catch(log.error); }; -const createWindow = async (window: AppWindow = "index.html") => { +const createWindow = async (window: AppWindow) => { if (isDebug) { await installExtensions(); } @@ -92,7 +93,7 @@ if (!gotTheLock) { const deepLink = process.argv.find(arg => DeepLinkService.getInstance().isDeepLink(arg)); if (!deepLink) { - createWindow(); + createWindow(!isE2E ? "launcher.html" : "index.html"); } else { DeepLinkService.getInstance().dispatchLinkOpened(deepLink); }