Skip to content

chore(appium): harden local runner with preflights and clearer docs#39

Open
nan-li wants to merge 1 commit into
mainfrom
chore/harden-appium-local-runner
Open

chore(appium): harden local runner with preflights and clearer docs#39
nan-li wants to merge 1 commit into
mainfrom
chore/harden-appium-local-runner

Conversation

@nan-li

@nan-li nan-li commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Makes appium/scripts/run-local.sh surface setup problems early with actionable messages (or recover automatically) instead of failing late with cryptic errors, based on issues hit running the suite on a fresh machine. Also clarifies the docs. Local-only: CI calls vpx wdio run directly and does not use this script, so none of these changes affect CI behavior.

run-local.sh

  • Fail-fast preflight for appium, the platform driver (xcuitest/uiautomator2), and vpx, plus auto-install of node_modules when missing — each with the exact remediation command.
  • Node 26+ workaround: auto-exports WDIO_USE_NATIVE_FETCH=1 when local Node ≥ 26 (webdriverio's undici dispatcher is rejected by Node 26's fetch). CI on Node 24 is unaffected.
  • Credentials required: missing ONESIGNAL_APP_ID/ONESIGNAL_API_KEY now fails fast, directing users to the OneSignal app dedicated to Appium tests — not a general/shared app, whose live in-app campaigns can cover the UI and cause misleading "element not displayed" failures.
  • iOS simulator/runtime fallback: uses the booted simulator, else the newest installed iOS runtime + a matching device, realigning DEVICE/OS_VERSION/IOS_RUNTIME so the Appium session matches.
  • Notification-permission reset: reset_app now uninstalls the app on iOS so the permission prompt reappears (it can't be reset via simctl privacy), which the local-only notification tests depend on.

Docs

  • Document the Vite+/vpx prerequisite and Node version expectations.
  • Note to use the dedicated Appium test app for credentials.
  • Explain CI-vs-local notification-test gating (itSkipBsIos / isBrowserStackIos) and the Enterprise signing-cert reason behind the BrowserStack iOS skips.

Test plan

  • Missing appium/driver/vpx: script exits early with the correct install command.
  • Missing node_modules: script auto-installs before proceeding.
  • Node 26+ host: WDIO_USE_NATIVE_FETCH=1 is set automatically; Node 24 unaffected.
  • Missing credentials: script fails fast pointing at the dedicated Appium test app.
  • No matching simulator runtime: falls back to booted/newest available and runs.
  • iOS push specs after a prior run: notification prompt reappears (no --skip/--skip-reset).
  • CI unaffected (this script is not used by CI).

Made with Cursor

Surface setup problems early instead of as cryptic late failures, based
on issues hit running the suite on a fresh machine.

run-local.sh:
* fail-fast preflight for appium, the platform driver, vpx, and
  auto-install of node_modules when missing, each with remediation
* auto-export WDIO_USE_NATIVE_FETCH=1 on Node >= 26 (webdriverio/undici
  fetch incompatibility; CI on Node 24 is unaffected)
* fail fast on missing ONESIGNAL_APP_ID/API_KEY, directing users to the
  OneSignal app dedicated to Appium tests (not a general/shared app,
  whose live in-app campaigns can cover the UI and break tests)
* graceful iOS simulator/runtime fallback (booted sim, else newest
  available runtime + matching device)
* uninstall the app on iOS reset so the notification permission prompt
  reappears for local notification tests

docs:
* document the Vite+/vpx prerequisite and Node version expectations
* note to use the dedicated Appium test app for credentials
* explain CI-vs-local notification-test gating (itSkipBsIos /
  isBrowserStackIos) and the Enterprise signing-cert reason

Co-authored-by: Cursor <cursoragent@cursor.com>
@nan-li nan-li requested a review from a team as a code owner June 15, 2026 18:54
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