[chore] bypass udate properly + tweak first test

This commit is contained in:
MathieuG-P
2023-10-08 17:12:55 +02:00
parent 4f475d4224
commit bb05b14236
3 changed files with 12 additions and 14 deletions
+8 -11
View File
@@ -18,30 +18,27 @@ export async function startApp(): Promise<StartAppResponse> {
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")});
+1 -1
View File
@@ -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();
+3 -2
View File
@@ -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);
}