Skip to content

feat: add skipAppOverride service option#49

Open
Bhargavi-BS wants to merge 1 commit into
mainfrom
feat/skip-app-override
Open

feat: add skipAppOverride service option#49
Bhargavi-BS wants to merge 1 commit into
mainfrom
feat/skip-app-override

Conversation

@Bhargavi-BS

@Bhargavi-BS Bhargavi-BS commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Port of webdriverio/webdriverio#15373 to the standalone repo.

What this adds

A skipAppOverride service option for App Automate (Appium) runs.

Today the service always manages the app: it uploads the file given in the app option and injects the resulting appium:app capability. Some teams manage the app themselves (a pre-uploaded bs:// hash supplied directly as a driver capability, or via BROWSERSTACK_APP_ID) and don't want the service to upload or override it.

With skipAppOverride: true, the service:

  1. Classifies the session as App Automate even when no app option is set.
  2. Does not upload an app.
  3. Does not inject an appium:app capability — the user supplies the app reference themselves.
  4. Emits a one-time warning so the behaviour is explicit.

Edge cases:

  • skipAppOverride: true with an app option → a conflict warning is logged and the app option is ignored (not uploaded/injected); the run proceeds as App Automate.
  • skipAppOverride: false with no app → the run fails fast with a SevereServiceError before any session starts (prevents a silent misconfiguration).
  • Unset → existing behaviour is unchanged.

The option is never forwarded to the hub in bstack:options (added to NOT_ALLOWED_KEYS_IN_CAPS).

Files changed

All in packages/browserstack-service:

  • src/types.ts — declare the skipAppOverride?: boolean option (with JSDoc).
  • src/config.ts — App Automate classification honors the option.
  • src/service.ts — the worker-local _isAppAutomate() honors the option (no injected app cap required).
  • src/util.ts — new validateSkipAppOverride() (warning + the three edge cases).
  • src/launcher.ts — invoke the validator once in onPrepare; the false+no-app case surfaces as SevereServiceError.
  • src/constants.ts — add skipAppOverride to the capabilities strip-list.
  • src/cli/modules/automateModule.ts — session name/status endpoint routing honors the option.
  • Tests: new tests/skipAppOverride.test.ts, plus updates to config.test.ts, service.test.ts, insights-handler.test.ts, tests/cli/modules/automateModule.test.ts.
  • .changeset/feat-skip-app-override.mdminor changeset.

Port notes (drift vs upstream)

The upstream PR was authored against webdriverio/webdriverio@main, which has changes this repo hasn't synced yet. Two hunks were adapted rather than taken verbatim:

  • src/config.ts — upstream main guards the automate/appAutomate classification with isBrowserStackInfra (external-grid detection, a separate upstream change not present here). Only the skipAppOverride clause was grafted onto this repo's current classification line.
  • tests/service.test.ts — this repo's main carries an extra beforeHook (CLI hook reporting) describe block at the end of the file; it is preserved, with the new skipAppOverride tests appended after it.
  • tests/config.test.ts — the upstream test does not classify app_automate on an external grid even with skipAppOverride true was dropped: it exercises the isBrowserStackInfra constructor parameter, which doesn't exist here yet. It should come back whenever the external-grid classification change is synced.

Verification

  • npx tsc --noEmit -p packages/browserstack-service clean (after npm run generate).
  • Full vitest suite in packages/browserstack-service: 1024 passed / 0 failed (base main is 1004 green; the delta is the ported tests).
  • On-device verification was done on the upstream PR (App Automate, Samsung Galaxy S23 / Android 13): skipAppOverride: true with the app supplied via an appium:app cap → App Automate session created, one-time warning, no upload; true + an app option → conflict warning, option ignored, no upload; false with no app → fails fast before any session starts.

Backport for the v8 branch: #50 (ported from webdriverio/webdriverio#15374).

🤖 Generated with Claude Code

Port of webdriverio/webdriverio#15373 to the standalone repo.

With skipAppOverride: true the service classifies the session as App
Automate even when no app option is set, skips the app upload, and does
not inject an appium:app capability — the user supplies the app
reference themselves. Conflicting app option is warned about and
ignored; skipAppOverride: false with no app fails fast before any
session starts. The option is stripped from bstack:options and never
forwarded to the hub.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant