Skip to content

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

Merged
okwasniewski merged 1 commit into
mainfrom
oskar/electron-launch-arguments
Nov 28, 2026
Merged

okwasniewski merged 1 commit into
mainfrom
oskar/electron-launch-arguments

Conversation

@okwasniewski

@okwasniewski okwasniewski commented Nov 28, 2026 •

Copy link
Copy Markdown
Member
  • 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 (feat(electron): per-test launch, keyboard, and window evaluate #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.

View guided diff Turn on auto-fix

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.

@github-actions github-actions Bot added e2e team Opened by the e2e team size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Electron launch option rename

Layer / File(s) Summary
Rename and validate the per-test launch option
packages/electron/src/fixtures.ts, packages/electron/src/options.ts, packages/electron/tests/unit/engine.test.ts, apps/electron-testbed/tests/fixture.e2e.ts, docs/electron.mdx, docs/migrate/playwright.mdx, docs/reference/electron.mdx, .changeset/electron-per-test-launch.md
ElectronLaunchOptions and checkLaunchOptions use launchArguments instead of args. Tests cover accepted and rejected values. Examples and reference material use the renamed option. The returned options shape still uses args.

Possibly related PRs

  • e2e-inc/e2e#2406: Introduces the per-test args option that this change renames to launchArguments.

Suggested reviewers: kdy1

Change: Refactor

Merge Risk: Minimal · up to f3b05

This renames the per-test Electron launch option from args to launchArguments, with validation, tests, docs and changeset updated to match. The package is unreleased, so the old key's rejection should not affect existing users. No merge-blocking risk was found.

Security architecture risk: Minimal · up to f3b05

The launch option has a new name, and callers using the old name receive an error. Argument ordering and the safeguards around app launch remain unchanged.

Retained concerns
No architecture-level concerns identified.

Security review details

Trust Boundaries and Controls

  • observed — The fixture still checks the entire options object for secret values before launch. The renamed argument list goes through the same string-array and engine-owned switch checks, including the existing checks for profile-directory and debugging switches. Environment and working-directory validation are unchanged.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7416e062-abf2-4970-9b57-516c93c95eb8
Commits

Reviewing files that changed from the base of the PR and between f52ac52 and f3b0550.

Files selected for processing: 8

  • .changeset/electron-per-test-launch.md
  • apps/electron-testbed/tests/fixture.e2e.ts
  • docs/electron.mdx
  • docs/migrate/playwright.mdx
  • docs/reference/electron.mdx
  • packages/electron/src/fixtures.ts
  • packages/electron/src/options.ts
  • packages/electron/tests/unit/engine.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 28, 2026
@okwasniewski
okwasniewski merged commit 7c1b2b2 into main Nov 28, 2026
45 checks passed
@okwasniewski
okwasniewski deleted the oskar/electron-launch-arguments branch November 28, 2026 16:08
eriveltonelias added a commit to eriveltonelias/e2e that referenced this pull request Nov 29, 2026
Bring docs/pt/electron.mdx in line with main's English after e2e-inc#2447, e2e-inc#2448,
and e2e-inc#2460: an element inside an inert subtree is found by getByText,
getByTestId, and electron.locator(), and input to it fails with
"it is inert"; the fixture table, the Security details, and the options
moved to /reference/electron; the aria-owns row is gone; and
electron.launch() takes launchArguments.

Add the Bug bashes section e2e-inc#2448 moved into docs/explore.mdx, reusing the
earlier pt translation of the deleted bug-bash page, with the new title,
description, lede sentence, and MCP server card.

The electron page keeps English's /reference/web#ondialog anchor, which
main had dropped: pt/reference/web has an onDialog heading, so it resolves.
mikolajadamowicz pushed a commit to mikolajadamowicz/e2e that referenced this pull request Nov 30, 2026
* docs(pt): sync 13 pages with English

Brings electron, executors, explore, integrations/revyl, migrate/playwright, reference/agent, reference/cli, reference/config, reference/engine, reference/errors, reference/screen, subscriptions, and telemetry in line with main 5a2adf1, and adds three glossary rows.

* docs(pt): re-sync electron and explore with English after e2e-inc#2448

Bring docs/pt/electron.mdx in line with main's English after e2e-inc#2447, e2e-inc#2448,
and e2e-inc#2460: an element inside an inert subtree is found by getByText,
getByTestId, and electron.locator(), and input to it fails with
"it is inert"; the fixture table, the Security details, and the options
moved to /reference/electron; the aria-owns row is gone; and
electron.launch() takes launchArguments.

Add the Bug bashes section e2e-inc#2448 moved into docs/explore.mdx, reusing the
earlier pt translation of the deleted bug-bash page, with the new title,
description, lede sentence, and MCP server card.

The electron page keeps English's /reference/web#ondialog anchor, which
main had dropped: pt/reference/web has an onDialog heading, so it resolves.

* docs(pt): point the explore MCP card at /coding-agents without an anchor

pt/coding-agents.mdx lags English after e2e-inc#2448, so the site gives it ids of
its own and #let-the-agent-use-the-app misses there. Link to the page until
pt/coding-agents catches up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e team Opened by the e2e team Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant