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
No known key found for this signature in database
3 changed files with 12 additions and 1 deletions

View File

@ -92,6 +92,7 @@
"electron-builder": "26.6.0",
"electron-builder-squirrel-windows": "26.6.0",
"electron-devtools-installer": "^4.0.0",
"electron-playwright-helpers": "^2.1.0",
"eslint": "^8.26.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^10.0.0",

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);
});

View File

@ -894,7 +894,7 @@
ajv "^6.12.0"
ajv-keywords "^3.4.1"
"@electron/asar@3.4.1", "@electron/asar@^3.3.1":
"@electron/asar@3.4.1", "@electron/asar@^3.2.4", "@electron/asar@^3.3.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@electron/asar/-/asar-3.4.1.tgz#4e9196a4b54fba18c56cd8d5cac67c5bdc588065"
integrity sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==
@ -3379,6 +3379,13 @@ electron-devtools-installer@^4.0.0:
dependencies:
unzip-crx-3 "^0.2.0"
electron-playwright-helpers@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/electron-playwright-helpers/-/electron-playwright-helpers-2.1.0.tgz#bafda622b236a53cdcfb7e8d62f3d62550fdbfce"
integrity sha512-aQOefS1irz/Ou6IYuTE34ZLmIKVHKoTGUwkVuwu2P5iguuMTLtsg6CFImsWu0cabRPVZ1NgEpcGPumFZNDdrqA==
dependencies:
"@electron/asar" "^3.2.4"
electron-publish@26.6.0:
version "26.6.0"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-26.6.0.tgz#94e8f00c163376ebb6b296544c11b61d3afc027d"