Playwright Electron (Vite) returning the DevTools window instead of the main window

When running a very basic playwright test on electron, for som reason firstWindow() is returning the devtools window.
import { test, expect, _electron as electron } from "@playwright/test";
import path from "path";

const electronAppPath = path.join(__dirname, "..", ".vite", "build", "main.js");

test("title should be accurate", async () => {
const app = await electron.launch({
args: [electronAppPath, "--no-sandbox"],
});
const page = await app.firstWindow();



expect(await page.title()).toBe("My App");
});
import { test, expect, _electron as electron } from "@playwright/test";
import path from "path";

const electronAppPath = path.join(__dirname, "..", ".vite", "build", "main.js");

test("title should be accurate", async () => {
const app = await electron.launch({
args: [electronAppPath, "--no-sandbox"],
});
const page = await app.firstWindow();



expect(await page.title()).toBe("My App");
});
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?