Skip to content

Commit 605274f

Browse files
feat(browserstack): add --provider-appium-version to pin the hosted Appium server
BrowserStack runs Appium 1.x for an App Automate session unless the request names a version in `bstack:options.appiumVersion`. The `mobile:` commands the WebDriver interactor issues (`deepLink`, `pressButton`, `activateApp`) need a 2.x or newer server, so a session left on the default fails those commands. `--provider-appium-version <version>` (alias `--appium-version`) joins the BrowserStack device-feature table beside `--provider-timezone` and friends, and threads through the same connection profile, lease scope, remote config and doctor surfaces. It is operator-only (`projectConfig: false`) and not recorded. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8dd6b85 commit 605274f

18 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"Untitled Project" / "Untitled Build" with an empty name — even after #2495 carried the flags to
1111
the provider (#2494). The builder now emits `appium:deviceName`, `appium:platformVersion`, and
1212
`appium:app` and no legacy key, verified against live App Automate sessions.
13+
- Added: `--provider-appium-version <version>` (alias `--appium-version`) pins the Appium server
14+
BrowserStack runs for the session, as `bstack:options.appiumVersion`. Unset, BrowserStack falls
15+
back to Appium 1.x, which predates the `mobile:` commands the interactor issues (`deepLink`,
16+
`pressButton`, `activateApp`).
1317
- Changed (sessions): the implicit session is now keyed by workspace **and platform**, so one checkout
1418
can drive iOS and Android without inventing a `--session` name for every command (#2580). An
1519
implicit session was addressed by `cwd:<workspace>:default`, one slot per checkout, and it stayed

‎packages/command-registry/src/flag-definitions-connection.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,16 @@ export const CONNECTION_FLAG_DEFINITIONS: readonly FlagDefinition[] = [
230230
projectConfig: false,
231231
recorded: false,
232232
},
233+
{
234+
key: 'providerAppiumVersion',
235+
names: ['--provider-appium-version', '--appium-version'],
236+
type: 'string',
237+
usageLabel: '--provider-appium-version <version>',
238+
usageDescription:
239+
'Hosted cloud provider Appium server version, for example 3.2.0. Without it BrowserStack falls back to its default (Appium 1.x)',
240+
projectConfig: false,
241+
recorded: false,
242+
},
233243
{
234244
key: 'providerLanguage',
235245
names: ['--provider-language', '--language'],

‎packages/command-registry/src/flag-groups.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const COMMON_COMMAND_SUPPORTED_FLAG_KEYS = flagKeys(
8282
'providerDeviceOrientation',
8383
'providerGeoLocation',
8484
'providerTimezone',
85+
'providerAppiumVersion',
8586
'providerLanguage',
8687
'providerLocale',
8788
'providerNetworkProfile',

‎packages/contracts/src/client-connection.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type AgentDeviceRequestOverrides = Pick<
6969
| 'providerDeviceOrientation'
7070
| 'providerGeoLocation'
7171
| 'providerTimezone'
72+
| 'providerAppiumVersion'
7273
| 'providerLanguage'
7374
| 'providerLocale'
7475
| 'providerNetworkProfile'

‎packages/contracts/src/lease-scope.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ const LEASE_ALLOCATE_PROVIDER_FLAG_KEYS = [
219219
'providerDeviceOrientation',
220220
'providerGeoLocation',
221221
'providerTimezone',
222+
'providerAppiumVersion',
222223
'providerLanguage',
223224
'providerLocale',
224225
'providerNetworkProfile',

‎packages/contracts/src/remote-config-fields.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type CloudProviderProfileFields = {
2929
providerDeviceOrientation?: ProviderDeviceOrientation;
3030
providerGeoLocation?: string;
3131
providerTimezone?: string;
32+
providerAppiumVersion?: string;
3233
providerLanguage?: string;
3334
providerLocale?: string;
3435
providerNetworkProfile?: string;

‎packages/provider-webdriver/src/browserstack-device-features.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const DEVICE_FEATURE_FIELDS = [
1414
'providerDeviceOrientation',
1515
'providerGeoLocation',
1616
'providerTimezone',
17+
'providerAppiumVersion',
1718
'providerLanguage',
1819
'providerLocale',
1920
'providerNetworkProfile',
@@ -34,6 +35,7 @@ test('configured device features project onto BrowserStack vendor capability key
3435
providerDeviceOrientation: 'portrait',
3536
providerGeoLocation: 'US',
3637
providerTimezone: 'New_York',
38+
providerAppiumVersion: '3.2.0',
3739
providerLanguage: 'Fr',
3840
providerLocale: 'Fr',
3941
providerNetworkProfile: '4g-lte-advanced-good',
@@ -46,6 +48,7 @@ test('configured device features project onto BrowserStack vendor capability key
4648
deviceOrientation: 'portrait',
4749
geoLocation: 'US',
4850
timezone: 'New_York',
51+
appiumVersion: '3.2.0',
4952
language: 'Fr',
5053
locale: 'Fr',
5154
networkProfile: '4g-lte-advanced-good',

‎packages/provider-webdriver/src/browserstack-device-features.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type BrowserStackDeviceFeatureFields = Pick<
2020
| 'providerDeviceOrientation'
2121
| 'providerGeoLocation'
2222
| 'providerTimezone'
23+
| 'providerAppiumVersion'
2324
| 'providerLanguage'
2425
| 'providerLocale'
2526
| 'providerNetworkProfile'
@@ -64,6 +65,14 @@ export const BROWSERSTACK_DEVICE_FEATURE_SPECS: readonly BrowserStackDeviceFeatu
6465
flag: '--provider-timezone',
6566
type: 'string',
6667
},
68+
{
69+
// BrowserStack defaults to Appium 1.x when unset; `mobile:` commands the interactor issues
70+
// (deepLink, pressButton, activateApp) need a 2.x+ server.
71+
field: 'providerAppiumVersion',
72+
capability: 'appiumVersion',
73+
flag: '--provider-appium-version',
74+
type: 'string',
75+
},
6776
{
6877
field: 'providerLanguage',
6978
capability: 'language',

‎scripts/integration-progress-model.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function summarizeProviderScenarioFlagExclusions() {
259259
'providerDeviceOrientation',
260260
'providerGeoLocation',
261261
'providerTimezone',
262+
'providerAppiumVersion',
262263
'providerLanguage',
263264
'providerLocale',
264265
'providerNetworkProfile',

‎src/cli-schema/command-overrides.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const SCHEMA_ONLY_CLI_COMMAND_SCHEMAS = {
8383
'providerDeviceOrientation',
8484
'providerGeoLocation',
8585
'providerTimezone',
86+
'providerAppiumVersion',
8687
'providerLanguage',
8788
'providerLocale',
8889
'providerNetworkProfile',

0 commit comments

Comments
 (0)