Confirm exit when running tests

This commit is contained in:
R Midhun Suresh
2026-02-05 17:28:07 +05:30
parent 067e8e27c1
commit be6fb4e881
3 changed files with 12 additions and 1 deletions
+3
View File
@@ -12,6 +12,7 @@ import path, { dirname } from "node:path";
import os from "node:os";
import { fileURLToPath } from "node:url";
import { PassThrough } from "node:stream";
import { stubDialog } from "electron-playwright-helpers";
/**
* A PassThrough stream that captures all data written to it.
@@ -111,6 +112,8 @@ export const test = base.extend<Fixtures>({
page: async ({ app }, use) => {
const window = await app.firstWindow();
await use(window);
// EW may be configured to ask for confirmation before the app exits.
await stubDialog(app, "showMessageBoxSync", 1);
await app.close().catch((e) => {
console.error(e);
});