History

Add a test seam to skip the background-service consent dialog under automation (#1170)

The first-run "keep Executor running in the background?" dialog cannot be answered from CDP or Playwright, so a packaged first-run boot under automation blocks here with no way to proceed (on macOS the modal also starves the app's main run loop). Add an EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE env seam, the same pattern confirmResetState already uses: "1" keeps the service, any other value declines, and when unset the dialog is shown as before.

Rhys Sullivan committed 4 months ago

Commit 0de01061 parent 94647f12 files · +12 −0Browse files

Unified · Split

2 files
  1. .changeset/desktop-background-service-consent-seam.md +5 −0
  2. apps/desktop/src/main/index.ts +7 −0
.changeset/desktop-background-service-consent-seam.md+5−0
@@ -0,0 +1,5 @@
1---
2"executor": patch
3---
4
5Add a test seam to skip the first-run "keep Executor running in the background?" consent dialog under automation, matching the existing `confirmResetState` seam. Set `EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE=1` to keep the background service or any other value to decline. When the variable is unset the dialog is shown exactly as before. Native dialogs cannot be answered from CDP or Playwright, so a packaged first-run boot under automation previously blocked at this prompt with no way to proceed.
apps/desktop/src/main/index.ts+7−0
@@ -190,6 +190,13 @@ const waitForSupervisedAttach = async ( · 189 unmodified lines
190};190};
191 191
192const confirmEnableBackgroundService = async (): Promise<boolean> => {192const confirmEnableBackgroundService = async (): Promise<boolean> => {
193 // EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam
194 // as confirmResetState. Native dialogs are unreachable from CDP/Playwright, so
195 // a first-run boot under automation otherwise blocks here forever with no way
196 // to answer. "1" keeps the background service; any other value declines and
197 // falls back to the managed sidecar.
198 const autoConfirm = process.env.EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE;
199 if (autoConfirm !== undefined) return autoConfirm === "1";
193 const { response } = await dialog.showMessageBox({200 const { response } = await dialog.showMessageBox({
194 type: "question",201 type: "question",
195 title: "Keep Executor running in the background?",202 title: "Keep Executor running in the background?",