This commit is contained in:
Core 2022-02-01 08:49:32 +00:00
parent a85868a70c
commit 5ba21a6c17
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -2,14 +2,14 @@ import { _electron as electron } from "playwright";
import { test, expect } from "@playwright/test"; import { test, expect } from "@playwright/test";
test("Launch electron app", async () => { test("Launch electron app", async () => {
const electronApp = await electron.launch({ args: ["./index.js"], cwd: "../build" }); const electronApp = await electron.launch({ args: ["./build/index.js"] });
const appPath = await electronApp.evaluate(async ({ app }) => { const appPath = await electronApp.evaluate(async ({ app }) => {
// This runs in the main Electron process, parameter here is always // This runs in the main Electron process, parameter here is always
// the result of the require('electron') in the main app script. // the result of the require('electron') in the main app script.
return app.getAppPath(); return app.getAppPath();
}); });
console.log(appPath); console.log(`cwd: ${appPath}`);