appium-webdriveragent 16.0.0 → 16.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Scripts/build-webdriveragent.mjs +8 -9
  3. package/Scripts/fetch-prebuilt-wda.mjs +16 -14
  4. package/Scripts/update-wda-version.mjs +12 -10
  5. package/WebDriverAgentLib/Info.plist +2 -2
  6. package/build/lib/check-dependencies.d.ts.map +1 -1
  7. package/build/lib/check-dependencies.js +1 -1
  8. package/build/lib/check-dependencies.js.map +1 -1
  9. package/build/lib/types.d.ts.map +1 -1
  10. package/build/lib/utils/index.d.ts +1 -1
  11. package/build/lib/utils/index.d.ts.map +1 -1
  12. package/build/lib/utils/index.js +1 -1
  13. package/build/lib/utils/index.js.map +1 -1
  14. package/build/lib/utils/module.d.ts.map +1 -1
  15. package/build/lib/utils/module.js +1 -1
  16. package/build/lib/utils/module.js.map +1 -1
  17. package/build/lib/utils/processes.d.ts.map +1 -1
  18. package/build/lib/utils/processes.js.map +1 -1
  19. package/build/lib/utils/security.d.ts.map +1 -1
  20. package/build/lib/utils/security.js.map +1 -1
  21. package/build/lib/utils/xctestrun.d.ts.map +1 -1
  22. package/build/lib/utils/xctestrun.js +4 -6
  23. package/build/lib/utils/xctestrun.js.map +1 -1
  24. package/build/lib/wda-strategies.d.ts +1 -1
  25. package/build/lib/wda-strategies.d.ts.map +1 -1
  26. package/build/lib/wda-strategies.js +3 -4
  27. package/build/lib/wda-strategies.js.map +1 -1
  28. package/build/lib/webdriveragent.d.ts +1 -1
  29. package/build/lib/webdriveragent.d.ts.map +1 -1
  30. package/build/lib/webdriveragent.js +6 -7
  31. package/build/lib/webdriveragent.js.map +1 -1
  32. package/build/lib/xcodebuild.d.ts +1 -1
  33. package/build/lib/xcodebuild.d.ts.map +1 -1
  34. package/build/lib/xcodebuild.js +7 -14
  35. package/build/lib/xcodebuild.js.map +1 -1
  36. package/lib/check-dependencies.ts +4 -8
  37. package/lib/types.ts +5 -3
  38. package/lib/utils/index.ts +1 -6
  39. package/lib/utils/module.ts +3 -5
  40. package/lib/utils/processes.ts +2 -3
  41. package/lib/utils/security.ts +2 -4
  42. package/lib/utils/xctestrun.ts +8 -21
  43. package/lib/wda-strategies.ts +8 -15
  44. package/lib/webdriveragent.ts +19 -34
  45. package/lib/xcodebuild.ts +18 -44
  46. package/package.json +56 -66
package/lib/xcodebuild.ts CHANGED
@@ -1,16 +1,13 @@
1
- import {retryInterval} from 'asyncbox';
2
- import {SubProcess, exec} from 'teen_process';
1
+ import path from 'node:path';
2
+
3
3
  import {logger, timing, util} from '@appium/support';
4
4
  import type {AppiumLogger, StringRecord} from '@appium/types';
5
- import {log as defaultLogger} from './logger.js';
6
- import {
7
- getWDAUpgradeTimestamp,
8
- isTvOS,
9
- setRealDeviceSecurity,
10
- setXctestrunFile,
11
- } from './utils/index.js';
12
- import path from 'node:path';
5
+ import {retryInterval} from 'asyncbox';
6
+ import {SubProcess, exec} from 'teen_process';
7
+
13
8
  import {WDA_RUNNER_BUNDLE_ID} from './constants.js';
9
+ import {log as defaultLogger} from './logger.js';
10
+ import type {NoSessionProxy} from './no-session-proxy.js';
14
11
  import type {
15
12
  AppleDevice,
16
13
  RetrieveBuildSettingsOptions,
@@ -18,7 +15,7 @@ import type {
18
15
  XcodeBuildSettings,
19
16
  XcodeShowBuildSettingsEntry,
20
17
  } from './types.js';
21
- import type {NoSessionProxy} from './no-session-proxy.js';
18
+ import {getWDAUpgradeTimestamp, isTvOS, setRealDeviceSecurity, setXctestrunFile} from './utils/index.js';
22
19
 
23
20
  const DEFAULT_SIGNING_ID = 'iPhone Developer';
24
21
  const PREBUILD_DELAY = 0;
@@ -27,11 +24,7 @@ const LIB_SCHEME_IOS = 'WebDriverAgentLib';
27
24
 
28
25
  const ERROR_WRITING_ATTACHMENT = 'Error writing attachment data to file';
29
26
  const ERROR_COPYING_ATTACHMENT = 'Error copying testing attachment';
30
- const IGNORED_ERRORS = [
31
- ERROR_WRITING_ATTACHMENT,
32
- ERROR_COPYING_ATTACHMENT,
33
- 'Failed to remove screenshot at path',
34
- ];
27
+ const IGNORED_ERRORS = [ERROR_WRITING_ATTACHMENT, ERROR_COPYING_ATTACHMENT, 'Failed to remove screenshot at path'];
35
28
  const IGNORED_ERRORS_PATTERN = new RegExp(
36
29
  '(' + IGNORED_ERRORS.map((errStr) => util.escapeRegExp(errStr)).join('|') + ')',
37
30
  );
@@ -76,10 +69,7 @@ export class XcodeBuild {
76
69
  private readonly resultBundleVersion?: string;
77
70
  private _didBuildFail: boolean;
78
71
  private _didProcessExit: boolean;
79
- private readonly _buildSettingsPromises = new Map<
80
- string,
81
- Promise<XcodeBuildSettings | undefined>
82
- >();
72
+ private readonly _buildSettingsPromises = new Map<string, Promise<XcodeBuildSettings | undefined>>();
83
73
  private noSessionProxy?: NoSessionProxy;
84
74
  private xctestrunFilePath?: string;
85
75
 
@@ -126,8 +116,7 @@ export class XcodeBuild {
126
116
  this.mjpegServerPort = args.mjpegServerPort;
127
117
  this.maxHttpRequestBodySize = args.maxHttpRequestBodySize;
128
118
 
129
- this.prebuildDelay =
130
- typeof args.prebuildDelay === 'number' ? args.prebuildDelay : PREBUILD_DELAY;
119
+ this.prebuildDelay = typeof args.prebuildDelay === 'number' ? args.prebuildDelay : PREBUILD_DELAY;
131
120
 
132
121
  this.allowProvisioningDeviceRegistration = args.allowProvisioningDeviceRegistration;
133
122
 
@@ -170,9 +159,7 @@ export class XcodeBuild {
170
159
  * @param options - Optional scheme, SDK, configuration, or destination
171
160
  * @returns Build settings for the `build` action, or `undefined` if they cannot be determined
172
161
  */
173
- async retrieveBuildSettings(
174
- options?: RetrieveBuildSettingsOptions,
175
- ): Promise<XcodeBuildSettings | undefined> {
162
+ async retrieveBuildSettings(options?: RetrieveBuildSettingsOptions): Promise<XcodeBuildSettings | undefined> {
176
163
  const cacheKey = buildSettingsCacheKey(options);
177
164
  let promise = this._buildSettingsPromises.get(cacheKey);
178
165
  if (!promise) {
@@ -319,9 +306,7 @@ export class XcodeBuild {
319
306
  if (!(err as Error)?.message?.includes(`Process didn't end after`)) {
320
307
  throw err;
321
308
  }
322
- this.log.debug(
323
- `xcodebuild process did not end in a timely fashion: '${(err as Error)?.message}'.`,
324
- );
309
+ this.log.debug(`xcodebuild process did not end in a timely fashion: '${(err as Error)?.message}'.`);
325
310
  }
326
311
 
327
312
  try {
@@ -335,9 +320,7 @@ export class XcodeBuild {
335
320
  }
336
321
  }
337
322
 
338
- private async fetchBuildSettings(
339
- options?: RetrieveBuildSettingsOptions,
340
- ): Promise<XcodeBuildSettings | undefined> {
323
+ private async fetchBuildSettings(options?: RetrieveBuildSettingsOptions): Promise<XcodeBuildSettings | undefined> {
341
324
  const schemeLabel = options?.scheme ?? 'default';
342
325
  let stdout: string;
343
326
  try {
@@ -349,9 +332,7 @@ export class XcodeBuild {
349
332
  ...buildSettingsArgsFromOptions(options),
350
333
  ]));
351
334
  } catch (err: any) {
352
- this.log.warn(
353
- `Cannot retrieve WDA build settings for scheme '${schemeLabel}'. Original error: ${err.message}`,
354
- );
335
+ this.log.warn(`Cannot retrieve WDA build settings for scheme '${schemeLabel}'. Original error: ${err.message}`);
355
336
  return;
356
337
  }
357
338
 
@@ -414,9 +395,7 @@ export class XcodeBuild {
414
395
  }
415
396
  args.push('-destination', `id=${this.device.udid}`);
416
397
 
417
- const versionMatch = this.platformVersion
418
- ? new RegExp(/^(\d+)\.(\d+)/).exec(this.platformVersion)
419
- : null;
398
+ const versionMatch = this.platformVersion ? new RegExp(/^(\d+)\.(\d+)/).exec(this.platformVersion) : null;
420
399
  if (versionMatch) {
421
400
  args.push(
422
401
  `${isTvOS(this.platformName || '') ? 'TV' : 'IPHONE'}OS_DEPLOYMENT_TARGET=${versionMatch[1]}.${versionMatch[2]}`,
@@ -434,10 +413,7 @@ export class XcodeBuild {
434
413
  args.push('-xcconfig', this.xcodeConfigFile);
435
414
  }
436
415
  if (this.xcodeOrgId && this.xcodeSigningId) {
437
- args.push(
438
- `DEVELOPMENT_TEAM=${this.xcodeOrgId}`,
439
- `CODE_SIGN_IDENTITY=${this.xcodeSigningId}`,
440
- );
416
+ args.push(`DEVELOPMENT_TEAM=${this.xcodeOrgId}`, `CODE_SIGN_IDENTITY=${this.xcodeSigningId}`);
441
417
  }
442
418
  if (this.updatedWDABundleId) {
443
419
  args.push(`PRODUCT_BUNDLE_IDENTIFIER=${this.updatedWDABundleId}`);
@@ -560,9 +536,7 @@ export class XcodeBuild {
560
536
  return currentStatus;
561
537
  }
562
538
 
563
- this.log.debug(
564
- `WebDriverAgent successfully started after ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`,
565
- );
539
+ this.log.debug(`WebDriverAgent successfully started after ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`);
566
540
  } catch (err: any) {
567
541
  this.log.debug(err.stack);
568
542
  throw new Error(
package/package.json CHANGED
@@ -1,9 +1,41 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "16.0.0",
3
+ "version": "16.0.2",
4
4
  "description": "Package bundling WebDriverAgent",
5
- "main": "./build/lib/index.js",
5
+ "keywords": [
6
+ "Appium",
7
+ "Selenium",
8
+ "WebDriver",
9
+ "WebDriverAgent",
10
+ "iOS"
11
+ ],
12
+ "homepage": "https://github.com/appium/WebDriverAgent#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/appium/WebDriverAgent/issues"
15
+ },
16
+ "license": "Apache-2.0",
17
+ "author": "Appium Contributors",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/appium/WebDriverAgent.git"
21
+ },
22
+ "files": [
23
+ "lib",
24
+ "build/lib",
25
+ "Scripts/build.sh",
26
+ "Scripts/embed-runner-icon.sh",
27
+ "Scripts/*.mjs",
28
+ "Configurations",
29
+ "PrivateHeaders",
30
+ "WebDriverAgent.xcodeproj",
31
+ "WebDriverAgentLib",
32
+ "WebDriverAgentRunner",
33
+ "WebDriverAgentTests",
34
+ "XCTWebDriverAgentLib",
35
+ "CHANGELOG.md"
36
+ ],
6
37
  "type": "module",
38
+ "main": "./build/lib/index.js",
7
39
  "types": "./build/lib/index.d.ts",
8
40
  "exports": {
9
41
  ".": {
@@ -16,10 +48,10 @@
16
48
  "build": "tsc -b",
17
49
  "dev": "npm run build -- --watch",
18
50
  "clean": "npm run build -- --clean",
19
- "lint": "eslint .",
20
- "lint:fix": "npm run lint -- --fix",
21
- "format": "prettier -w ./lib ./test",
22
- "format:check": "prettier --check ./lib ./test",
51
+ "lint": "oxlint -c oxlint.config.mjs .",
52
+ "lint:fix": "oxlint -c oxlint.config.mjs --fix .",
53
+ "format": "oxfmt -c oxfmt.config.mjs .",
54
+ "format:check": "oxfmt -c oxfmt.config.mjs --check .",
23
55
  "prepare": "npm run build",
24
56
  "version": "npm run sync-wda-version",
25
57
  "test": "node --enable-source-maps --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
@@ -30,74 +62,32 @@
30
62
  "fetch-prebuilt-wda": "node ./Scripts/fetch-prebuilt-wda.mjs",
31
63
  "sync-wda-version": "node ./Scripts/update-wda-version.mjs --package-version=${npm_package_version} && git add WebDriverAgentLib/Info.plist"
32
64
  },
33
- "engines": {
34
- "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
35
- "npm": ">=10"
36
- },
37
- "prettier": {
38
- "bracketSpacing": false,
39
- "printWidth": 100,
40
- "singleQuote": true
41
- },
42
- "repository": {
43
- "type": "git",
44
- "url": "git+https://github.com/appium/WebDriverAgent.git"
45
- },
46
- "keywords": [
47
- "Appium",
48
- "iOS",
49
- "WebDriver",
50
- "Selenium",
51
- "WebDriverAgent"
52
- ],
53
- "author": "Appium Contributors",
54
- "license": "Apache-2.0",
55
- "bugs": {
56
- "url": "https://github.com/appium/WebDriverAgent/issues"
65
+ "dependencies": {
66
+ "@appium/base-driver": "^10.3.0",
67
+ "@appium/strongbox": "^1.0.0-rc.1",
68
+ "@appium/support": "^7.2.1",
69
+ "appium-ios-simulator": "^9.0.0",
70
+ "async-lock": "^1.0.0",
71
+ "asyncbox": "^6.1.0",
72
+ "axios": "^1.16.0",
73
+ "teen_process": "^4.0.7"
57
74
  },
58
- "homepage": "https://github.com/appium/WebDriverAgent#readme",
59
75
  "devDependencies": {
60
- "@appium/eslint-config-appium-ts": "^3.0.0",
76
+ "@appium/oxc-config": "^1.1.0",
77
+ "@appium/semantic-release-config": "^1.1.0",
61
78
  "@appium/tsconfig": "^1.0.0-rc.1",
62
79
  "@appium/types": "^1.0.0-rc.1",
63
- "@semantic-release/changelog": "^6.0.1",
64
- "@semantic-release/git": "^10.0.1",
65
80
  "@types/async-lock": "^1.4.2",
66
81
  "@types/node": "^26.0.0",
67
82
  "@types/sinon": "^22.0.0",
68
- "appium-xcode": "^6.0.0",
69
- "conventional-changelog-conventionalcommits": "^9.3.1",
83
+ "appium-xcode": "^7.0.0",
70
84
  "esmock": "^2.7.6",
71
- "node-simctl": "^8.0.0",
72
- "prettier": "^3.9.3",
73
- "semantic-release": "^25.0.2",
85
+ "node-simctl": "^9.0.0",
74
86
  "semver": "^7.3.7",
75
- "sinon": "^22.0.0",
76
- "typescript": "^6.0.2"
77
- },
78
- "dependencies": {
79
- "@appium/base-driver": "^10.3.0",
80
- "@appium/strongbox": "^1.0.0-rc.1",
81
- "@appium/support": "^7.2.1",
82
- "appium-ios-simulator": "^8.0.0",
83
- "async-lock": "^1.0.0",
84
- "asyncbox": "^6.1.0",
85
- "axios": "^1.16.0",
86
- "teen_process": "^4.0.7"
87
+ "sinon": "^22.0.0"
87
88
  },
88
- "files": [
89
- "lib",
90
- "build/lib",
91
- "Scripts/build.sh",
92
- "Scripts/embed-runner-icon.sh",
93
- "Scripts/*.mjs",
94
- "Configurations",
95
- "PrivateHeaders",
96
- "WebDriverAgent.xcodeproj",
97
- "WebDriverAgentLib",
98
- "WebDriverAgentRunner",
99
- "WebDriverAgentTests",
100
- "XCTWebDriverAgentLib",
101
- "CHANGELOG.md"
102
- ]
89
+ "engines": {
90
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
91
+ "npm": ">=10"
92
+ }
103
93
  }