Skip to content

Add E2E tests#334

Open
gabrieldonadel wants to merge 14 commits intomainfrom
claude/cross-platform-e2e-testing-e2oTX
Open

Add E2E tests#334
gabrieldonadel wants to merge 14 commits intomainfrom
claude/cross-platform-e2e-testing-e2oTX

Conversation

@gabrieldonadel
Copy link
Copy Markdown
Member

No description provided.

@gabrieldonadel gabrieldonadel force-pushed the claude/cross-platform-e2e-testing-e2oTX branch 2 times, most recently from d540dab to 3066492 Compare April 13, 2026 18:19
gabrieldonadel and others added 3 commits April 14, 2026 15:25
- Add testIDs to shared React Native components (Footer, BuildsSection,
  Item, SectionHeader, Onboarding, Settings) so both platforms can test
  the same UI elements
- Create shared e2e/testIDs.ts as the source of truth for test identifiers
- Clean up Electron WebdriverIO config: auto-detect platform/arch for binary
  path, remove boilerplate comments, reduce log level
- Improve Electron E2E tests: structured into Onboarding and Popover
  describe blocks, test builds section, footer buttons, and onboarding flow
- Add macOS XCUITest UI tests matching the same scenarios as Electron
  (onboarding flow, popover content, builds section, footer)
- Add setup script (add_ui_test_target.rb) to integrate XCUITest target
  into the Xcode project
- Add GitHub Actions workflow for E2E tests: runs Electron tests on
  Linux + Windows, macOS XCUITest on macos-14

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
Replace the split XCUITest + Electron testing approach with a single
WebdriverIO test suite that runs the same specs on both platforms.

- Move all E2E infrastructure to apps/menu-bar/e2e/ with its own
  package.json, tsconfig, and dependencies
- Add platform-aware byTestId/allByTestId helpers: uses CSS
  `[data-testid]` selector for Electron, Appium accessibility id
  `~` selector for macOS native
- Create wdio.shared.ts (framework, reporters, timeouts),
  wdio.electron.ts (electron service + auto-detect binary path),
  wdio.macos.ts (Appium mac2 driver + bundle ID)
- Split test specs into onboarding.e2e.ts and popover.e2e.ts,
  both platform-agnostic
- Remove XCUITest files, old electron/test/ dir, and wdio deps
  from electron package.json
- Update CI workflow: Electron on Linux + Windows, macOS via
  Appium mac2 on macos-14 runner

Run with: yarn test:electron or yarn test:macos from e2e/

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c

Fix CI failures in E2E workflow

- Restore electron/yarn.lock from main to fix frozen-lockfile mismatch
  after wdio deps were moved to e2e/package.json (exit code 128)
- Fix macOS job: run bundle install from apps/menu-bar/ where Gemfile
  lives, not from macos/ subdirectory
- Add JS bundle step before xcodebuild (react-native bundle for macOS,
  expo export for Electron)
- Use yarn install without --frozen-lockfile for e2e/ since it has no
  lockfile yet
- Pass MACOS_APP_PATH env var to the macOS test runner

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c

Fix workflows

Fix lint formatting and macOS CocoaPods working directory

- Fix prettier formatting in wdio.macos.ts (combine line 4 into line 5
  now that it fits under 100 chars) so the lint job passes
- Run pod install from apps/menu-bar/macos/ directly instead of using
  --project-directory flag, because the Podfile uses relative paths
  (./Podfile.properties.json, ./build) that resolve from Ruby's CWD

Specify Electron browserVersion so tests work without local electron install

The wdio-electron-service errors with "You must install Electron
locally, or provide a custom Chromedriver path / browserVersion value
for each Electron capability" because the e2e package is separate
from the electron package and doesn't have electron as a dependency.

Setting browserVersion lets the service fetch the matching Chromedriver
without needing electron in this package's node_modules.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c

Exclude e2e from menu-bar TSC and add dedicated e2e typecheck step

The menu-bar tsconfig was picking up e2e/*.ts files and failing to
resolve wdio/appium types that are only installed in the e2e package.

- Add 'e2e' to menu-bar's tsconfig.json exclude list
- Add 'TSC Orbit e2e files' step to lint-and-tsc.yml that installs
  e2e deps and runs tsc --noEmit from apps/menu-bar/e2e

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c

Use browserName to detect platform in e2e helpers

The previous 'automationName' capability access caused a TypeScript
error in the new TSC e2e step because that property isn't in standard
WebDriver Capabilities (it's an Appium-specific extension).

Check `browser.capabilities.browserName === 'electron'` instead:
Electron service sets browserName to 'electron', while Appium mac2
leaves it unset.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c

Use macOS 15

Fix hermes version

Setup ruby
@gabrieldonadel gabrieldonadel force-pushed the claude/cross-platform-e2e-testing-e2oTX branch from 11e76e3 to 699d71d Compare April 14, 2026 18:27
@gabrieldonadel gabrieldonadel mentioned this pull request Apr 16, 2026
claude and others added 10 commits April 17, 2026 18:02
Two issues surfaced when running 'yarn test:macos' locally:

1. "Cannot redefine property: soft" error from expect-webdriverio —
   caused by importing expect from 'expect-webdriverio' directly while
   @wdio/globals also registers it, leading to double-loading.
   Fix: import expect from '@wdio/globals' instead (v9 recommended).

2. "Failed to determine bundle identifier" — appium-mac2-driver resolves
   'appium:appPath' relative to WebDriverAgentRunner's sandboxed
   container, not the e2e directory. Also, the correct capability name
   is 'appium:app', not 'appium:appPath'.
   Fix: resolve to absolute path with path.resolve(__dirname, ...) and
   use 'appium:app'.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
Persisted state (has-seen-onboarding in MMKV) causes the onboarding
test to fail on subsequent runs because the onboarding window no longer
shows. Also, appium-mac2-driver doesn't implement WebDriver's
/window/handles endpoint — that's a web-browser concept.

Changes:

- Add e2e/scripts/reset-state.sh that clears MMKV storage (macOS non-
  sandboxed Release: ~/Documents/mmkv, sandboxed Debug: app container)
  and electron-store userData for both macOS and Linux. Wire it up as
  pretest:electron and pretest:macos scripts so every test run starts
  from a clean state.
- Rewrite onboarding.e2e.ts to branch on browserName: Electron still
  uses getWindowHandles + switchToWindow (needed because each window
  is a separate BrowserWindow context); macOS queries elements directly
  from the shared app accessibility tree.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
When both appium:bundleId and appium:app were set, appium-mac2-driver
resolved the app via the bundle ID first — launching the installed
/Applications/Expo Orbit.app instead of the local Release build passed
via MACOS_APP_PATH.

The driver derives the bundle ID from the .app's Info.plist on its own.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
When appium:app points to a non-existent path, the Mac2 driver silently
does nothing. Check that the .app exists on disk and:
- if it does, log the absolute path being used
- if it doesn't, warn the user and fall back to launching via
  appium:bundleId (the installed app with id 'dev.expo.orbit')

Never set appium:app and appium:bundleId simultaneously — the driver
prefers the installed app when both are present and ignores appium:app.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
- Add CHANGELOG entry for E2E testing (fixes changelog enforcer)
- Remove appium-mac2-driver from e2e/package.json to avoid conflict
  with 'appium driver install mac2' in CI (driver is registered via
  appium CLI, not as an npm dependency)
- Remove redundant 'gem install cocoapods' — bundler-cache handles it
  via the Gemfile
- Add explicit 'Bundle JS for macOS' step before xcodebuild — Release
  config needs a pre-built main.jsbundle
- Remove xcpretty pipe (not in Gemfile, not installed)

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
xcodebuild's "Bundle React Native code and images" build phase already
handles JS bundling during the build. The explicit react-native bundle
step was failing because the react-native-macos CLI setup differs from
vanilla react-native.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
The xcodebuild step fails with exit code 65 on the macos-15 runner
because the default Xcode version is incompatible with the project.
Re-add the explicit Xcode 26.2 switch that was present in the user's
earlier workflow fix.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
The xcodebuild step fails with exit code 65 on the macos-15 runner
because the default Xcode version is incompatible with the project.
Re-add the explicit Xcode 26.2 switch that was present in the user's
earlier workflow fix.

https://claude.ai/code/session_01Nm2T5gr34aKwC2nb3fxt8c
@gabrieldonadel gabrieldonadel force-pushed the claude/cross-platform-e2e-testing-e2oTX branch 2 times, most recently from b85429f to fbb7753 Compare April 20, 2026 11:30
@gabrieldonadel gabrieldonadel force-pushed the claude/cross-platform-e2e-testing-e2oTX branch 7 times, most recently from 9053d35 to fdb2b98 Compare April 20, 2026 13:39
@gabrieldonadel gabrieldonadel force-pushed the claude/cross-platform-e2e-testing-e2oTX branch from fdb2b98 to 4423f26 Compare April 20, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants