refactor(electron): rename electron.launch()'s args option to launchArguments

Merged
OK
3d ago
+23-22
  • electron.launch({ args }) is now electron.launch({ launchArguments }), the name the target's app.launchArguments and mobile's device.openApp(app, { launchArguments }) already use.
  • Nothing else changes: the arguments still go after the target's app.launchArguments, and env, cwd, and timeout keep their names.
  • electron.launch() is unreleased (#2406, @e2e-dev/electron is 0.0.0 on npm), so this is not a breaking change. The pending changeset .changeset/electron-per-test-launch.md is edited in place.
  • The old key is refused like any unknown option, with INVALID_ARGUMENT (packages/electron/src/options.ts:147).
await electron.launch({
  launchArguments: ['--skip-onboarding'],
  env: { APP_DATA_PATH: electron.userDataDir },
});

One difference from mobile stays, for review: on Electron the test's launchArguments are added after the target's, while device.openApp replaces the target's for that launch.

Verified

Ran it locally: yes

  • Electron testbed on macOS, pnpm --filter @e2e-dev/electron-testbed test: 87 of 87 pass, with tests/fixture.e2e.ts launching the app through electron.launch({ launchArguments: ['--per-test'], env }) and reading --per-test back from process.argv in the main process, after app.restart() too.
  • Not run: Windows and Linux, which CI covers.

Summary by CodeRabbit

  • Changed
    • Renamed the per-test electron.launch() option from args to launchArguments across the API, examples, and migration guidance. Existing validation and launch behavior remain unchanged.