From c9d09a9d5e2517139494cc5526b5a2098e2481ca Mon Sep 17 00:00:00 2001 From: KVNLS Date: Thu, 21 Sep 2023 14:28:36 +0200 Subject: [PATCH] fix: debug electron --- .../tests/fixtures/common.ts | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/apps/ledger-live-desktop/tests/fixtures/common.ts b/apps/ledger-live-desktop/tests/fixtures/common.ts index 8c6c85a668da..9558782ea0eb 100644 --- a/apps/ledger-live-desktop/tests/fixtures/common.ts +++ b/apps/ledger-live-desktop/tests/fixtures/common.ts @@ -65,42 +65,41 @@ const test = base.extend({ LEDGER_MIN_HEIGHT: 768, FEATURE_FLAGS: JSON.stringify(featureFlags), DESKTOP_LOGS_FILE: path.join(__dirname, "../artifacts/logs"), + VERBOSE: true, + ELECTRON_ENABLE_LOGGING: true, }, env, ); // launch app const windowSize = { width: 1024, height: 768 }; - try { - const electronApp: ElectronApplication = await electron.launch({ - args: [ - `${path.join(__dirname, "../../.webpack/main.bundle.js")}`, - `--user-data-dir=${userdataDestinationPath}`, - // `--window-size=${window.width},${window.height}`, // FIXME: Doesn't work, window size can't be forced? - "--force-device-scale-factor=1", - "--disable-dev-shm-usage", - // "--use-gl=swiftshader" - "--no-sandbox", - "--enable-logging", - ], - recordVideo: { - dir: `${path.join(__dirname, "../artifacts/videos/")}`, - size: windowSize, // FIXME: no default value, it could come from viewport property in conf file but it's not the case - }, - env: { ...env, NODE_ENV: "development" }, - colorScheme: theme, - locale: lang, - executablePath: require("electron/index.js"), - timeout: 120000, - }); - - await use(electronApp); - - // close app - await electronApp.close(); - } catch (error) { - console.log(error); - } + + const electronApp: ElectronApplication = await electron.launch({ + args: [ + `${path.join(__dirname, "../../.webpack/main.bundle.js")}`, + `--user-data-dir=${userdataDestinationPath}`, + // `--window-size=${window.width},${window.height}`, // FIXME: Doesn't work, window size can't be forced? + "--force-device-scale-factor=1", + "--disable-dev-shm-usage", + // "--use-gl=swiftshader" + "--no-sandbox", + "--enable-logging", + ], + recordVideo: { + dir: `${path.join(__dirname, "../artifacts/videos/")}`, + size: windowSize, // FIXME: no default value, it could come from viewport property in conf file but it's not the case + }, + env: { ...env, NODE_ENV: "development" }, + colorScheme: theme, + locale: lang, + executablePath: require("electron/index.js"), + timeout: 120000, + }); + + await use(electronApp); + + // close app + await electronApp.close(); }, page: async ({ electronApp }, use) => { // app is ready