Skip to content

Commit

Permalink
Make console logs more accessible during Playwright e2e test runs (#3066
Browse files Browse the repository at this point in the history
)
  • Loading branch information
philrz authored May 3, 2024
1 parent 604632e commit 730a6a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/zui/src/electron/run-main/before-boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import {windowsPre25Exists} from "../windows-pre-25"
import {MainArgs} from "./args"
import {setLogLevel} from "../set-log-level"
import {runMigrations} from "./run-migrations"
import log from "electron-log"

app.disableHardwareAcceleration()

export async function beforeBoot(
args: Partial<MainArgs>
): Promise<string | null> {
// Ensure all console logs go through electron-log
console.log = log.log

// Disable security warnings
// process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = "true"
// Setup app paths, this must be first
Expand Down
5 changes: 5 additions & 0 deletions packages/zui-player/helpers/test-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export default class TestApp {
if (bin) launchOpts.executablePath = bin;
this.zui = await electron.launch(launchOpts);

// Pipe the stdout from the electron process into the test runner process
if (process.env['VERBOSE']) {
this.zui.process().stdout.pipe(process.stdout);
}

await waitForTrue(() => this.zui.windows().length === 2);
await waitForTrue(async () => !!(await this.getWindowByTitle('Zui')));
await waitForTrue(
Expand Down

0 comments on commit 730a6a9

Please sign in to comment.