Skip to content

Commit

Permalink
fix: debug electron
Browse files Browse the repository at this point in the history
  • Loading branch information
KVNLS committed Sep 21, 2023
1 parent 37c9762 commit c9d09a9
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions apps/ledger-live-desktop/tests/fixtures/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,42 +65,41 @@ const test = base.extend<TestFixtures>({
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
Expand Down

0 comments on commit c9d09a9

Please sign in to comment.