#52811: test: close the sign-in dialog the inAppPurchase suite leaves on screen
Description of Change
Without an App Store session, StoreKit answers inAppPurchase.restoreCompletedTransactions() with an Apple Account sign-in dialog shown by a system agent, and nothing dismisses it, so it stays centred on screen for the rest of the job. Whenever script/split-tests.js places api-in-app-purchase-spec.ts ahead of the screen-capture tests in a shard, the <webview> / WebContentsView transparency and border-radius captures read the dialog's grey (#ececec) instead of the page and fail; any PR that adds enough tests to reshuffle the macOS arm64 split hits it (e.g. #52807, #52808), and the uploaded color-mismatch-*.png artifacts show the sign-in sheet over the capture point. The suite now snapshots the processes that own on-screen windows before it runs and, afterwards, terminates any system agent that has put up a window since, until the screen is back to what it was.
Checklist
- PR description included and stakeholders cc'd
-
npm testpasses - tests are changed or added
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron