appium-webdriveragent 10.5.3 → 11.0.0

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 (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/Scripts/{build-webdriveragent.js → build-webdriveragent.mjs} +13 -7
  3. package/Scripts/{fetch-prebuilt-wda.js → fetch-prebuilt-wda.mjs} +17 -9
  4. package/Scripts/update-wda-version.mjs +42 -0
  5. package/WebDriverAgentLib/Info.plist +2 -2
  6. package/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +6503 -6229
  7. package/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncUdpSocket.m +4107 -3883
  8. package/build/index.d.ts +1 -1
  9. package/build/index.d.ts.map +1 -1
  10. package/build/index.js +1 -2
  11. package/build/index.js.map +1 -1
  12. package/build/lib/check-dependencies.d.ts +2 -7
  13. package/build/lib/check-dependencies.d.ts.map +1 -1
  14. package/build/lib/check-dependencies.js +0 -11
  15. package/build/lib/check-dependencies.js.map +1 -1
  16. package/build/lib/constants.d.ts +12 -12
  17. package/build/lib/constants.d.ts.map +1 -1
  18. package/build/lib/constants.js +14 -26
  19. package/build/lib/constants.js.map +1 -1
  20. package/build/lib/logger.d.ts +1 -2
  21. package/build/lib/logger.d.ts.map +1 -1
  22. package/build/lib/logger.js +2 -2
  23. package/build/lib/logger.js.map +1 -1
  24. package/build/lib/no-session-proxy.d.ts +5 -5
  25. package/build/lib/no-session-proxy.d.ts.map +1 -1
  26. package/build/lib/no-session-proxy.js +0 -1
  27. package/build/lib/no-session-proxy.js.map +1 -1
  28. package/build/lib/utils.d.ts +53 -96
  29. package/build/lib/utils.d.ts.map +1 -1
  30. package/build/lib/utils.js +124 -110
  31. package/build/lib/utils.js.map +1 -1
  32. package/build/lib/webdriveragent.d.ts +123 -170
  33. package/build/lib/webdriveragent.d.ts.map +1 -1
  34. package/build/lib/webdriveragent.js +319 -349
  35. package/build/lib/webdriveragent.js.map +1 -1
  36. package/build/lib/xcodebuild.d.ts +66 -77
  37. package/build/lib/xcodebuild.d.ts.map +1 -1
  38. package/build/lib/xcodebuild.js +123 -92
  39. package/build/lib/xcodebuild.js.map +1 -1
  40. package/build/test/functional/desired.d.ts +3 -0
  41. package/build/test/functional/desired.d.ts.map +1 -0
  42. package/build/test/functional/desired.js +9 -0
  43. package/build/test/functional/desired.js.map +1 -0
  44. package/build/test/functional/helpers/simulator.d.ts +5 -0
  45. package/build/test/functional/helpers/simulator.d.ts.map +1 -0
  46. package/build/test/functional/helpers/simulator.js +39 -0
  47. package/build/test/functional/helpers/simulator.js.map +1 -0
  48. package/build/test/functional/webdriveragent-e2e-specs.d.ts +2 -0
  49. package/build/test/functional/webdriveragent-e2e-specs.d.ts.map +1 -0
  50. package/build/test/functional/webdriveragent-e2e-specs.js +133 -0
  51. package/build/test/functional/webdriveragent-e2e-specs.js.map +1 -0
  52. package/build/test/unit/utils-specs.d.ts +2 -0
  53. package/build/test/unit/utils-specs.d.ts.map +1 -0
  54. package/build/test/unit/utils-specs.js +161 -0
  55. package/build/test/unit/utils-specs.js.map +1 -0
  56. package/build/test/unit/webdriveragent-specs.d.ts +2 -0
  57. package/build/test/unit/webdriveragent-specs.d.ts.map +1 -0
  58. package/build/test/unit/webdriveragent-specs.js +424 -0
  59. package/build/test/unit/webdriveragent-specs.js.map +1 -0
  60. package/build/tsconfig.tsbuildinfo +1 -0
  61. package/index.ts +1 -1
  62. package/lib/{check-dependencies.js → check-dependencies.ts} +4 -13
  63. package/lib/constants.ts +18 -0
  64. package/lib/logger.ts +3 -0
  65. package/lib/{no-session-proxy.js → no-session-proxy.ts} +4 -5
  66. package/lib/{utils.js → utils.ts} +101 -111
  67. package/lib/{webdriveragent.js → webdriveragent.ts} +353 -390
  68. package/lib/{xcodebuild.js → xcodebuild.ts} +145 -114
  69. package/package.json +7 -9
  70. package/lib/constants.js +0 -24
  71. package/lib/logger.js +0 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [11.0.0](https://github.com/appium/WebDriverAgent/compare/v10.5.4...v11.0.0) (2025-12-21)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * Removed the deprecated xcodeVersion argument from WebDriverAgent constructor
6
+ * Removed the deprecated xcodeVersion argument from XcodeBuild constructor
7
+ * Removed the deprecated idb property from WebDriverAgent class
8
+ * Removed the noop checkForDependencies export from index
9
+
10
+ - All .js modules were migrated to TypeScript
11
+ - Module scripts were migrated to ESM/.mjs
12
+ - All private WebDriverAgent and XcodeBuild methods and properties were marked as such
13
+
14
+ ### Features
15
+
16
+ * Migrate the module to typescript ([#1096](https://github.com/appium/WebDriverAgent/issues/1096)) ([7d0a022](https://github.com/appium/WebDriverAgent/commit/7d0a022585ef70205dafe22d20736978d9e1cba3))
17
+
18
+ ## [10.5.4](https://github.com/appium/WebDriverAgent/compare/v10.5.3...v10.5.4) (2025-12-19)
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * Apply format to socket helpers ([#1092](https://github.com/appium/WebDriverAgent/issues/1092)) ([ddc6313](https://github.com/appium/WebDriverAgent/commit/ddc631371350ef04ab8f49a93f1f674cab9aefde))
23
+
1
24
  ## [10.5.3](https://github.com/appium/WebDriverAgent/compare/v10.5.2...v10.5.3) (2025-12-19)
2
25
 
3
26
  ### Miscellaneous Chores
@@ -1,8 +1,13 @@
1
- const path = require('path');
2
- const { asyncify } = require('asyncbox');
3
- const { logger, fs } = require('@appium/support');
4
- const { exec } = require('teen_process');
5
- const xcode = require('appium-xcode');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { asyncify } from 'asyncbox';
4
+ import { logger, fs } from '@appium/support';
5
+ import { exec } from 'teen_process';
6
+ import * as xcode from 'appium-xcode';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const isMainModule = process.argv[1] && path.resolve(process.argv[1]) === __filename;
6
11
 
7
12
  const LOG = new logger.getLogger('WDABuild');
8
13
  const ROOT_DIR = path.resolve(__dirname, '..');
@@ -72,8 +77,9 @@ async function buildWebDriverAgent (xcodeVersion) {
72
77
  LOG.info(`Zip bundled at "${appBundleZipPath}"`);
73
78
  }
74
79
 
75
- if (require.main === module) {
80
+ if (isMainModule) {
76
81
  asyncify(buildWebDriverAgent);
77
82
  }
78
83
 
79
- module.exports = buildWebDriverAgent;
84
+ export default buildWebDriverAgent;
85
+
@@ -1,14 +1,21 @@
1
- const path = require('path');
2
- const axios = require('axios');
3
- const { asyncify } = require('asyncbox');
4
- const { logger, fs, mkdirp, net } = require('@appium/support');
5
- const _ = require('lodash');
6
- const B = require('bluebird');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { readFileSync } from 'node:fs';
4
+ import axios from 'axios';
5
+ import { asyncify } from 'asyncbox';
6
+ import { logger, fs, mkdirp, net } from '@appium/support';
7
+ import _ from 'lodash';
8
+ import B from 'bluebird';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const isMainModule = process.argv[1] && path.resolve(process.argv[1]) === __filename;
7
13
 
8
14
  const log = logger.getLogger('WDA');
9
15
 
10
16
  async function fetchPrebuiltWebDriverAgentAssets () {
11
- const tag = require('../package.json').version;
17
+ const packageJson = JSON.parse(readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf8'));
18
+ const tag = packageJson.version;
12
19
  log.info(`Getting links to webdriveragent release ${tag}`);
13
20
  const downloadUrl = `https://api.github.com/repos/appium/webdriveragent/releases/tags/v${tag}`;
14
21
  log.info(`Getting WDA release ${downloadUrl}`);
@@ -54,8 +61,9 @@ async function fetchPrebuiltWebDriverAgentAssets () {
54
61
  return await B.all(agentsDownloading);
55
62
  }
56
63
 
57
- if (require.main === module) {
64
+ if (isMainModule) {
58
65
  asyncify(fetchPrebuiltWebDriverAgentAssets);
59
66
  }
60
67
 
61
- module.exports = fetchPrebuiltWebDriverAgentAssets;
68
+ export default fetchPrebuiltWebDriverAgentAssets;
69
+
@@ -0,0 +1,42 @@
1
+ import {plist, logger} from '@appium/support';
2
+ import path from 'node:path';
3
+ import semver from 'semver';
4
+
5
+ const log = logger.getLogger('Versioner');
6
+
7
+ /**
8
+ * @param {string} argName
9
+ * @returns {string|null}
10
+ */
11
+ function parseArgValue (argName) {
12
+ const argNamePattern = new RegExp(`^--${argName}\\b`);
13
+ for (let i = 1; i < process.argv.length; ++i) {
14
+ const arg = process.argv[i];
15
+ if (argNamePattern.test(arg)) {
16
+ return arg.includes('=') ? arg.split('=')[1] : process.argv[i + 1];
17
+ }
18
+ }
19
+ return null;
20
+ }
21
+
22
+ async function updateWdaVersion() {
23
+ const newVersion = parseArgValue('package-version');
24
+ if (!newVersion) {
25
+ throw new Error('No package version argument (use `--package-version=xxx`)');
26
+ }
27
+ if (!semver.valid(newVersion)) {
28
+ throw new Error(
29
+ `Invalid version specified '${newVersion}'. Version should be in the form '1.2.3'`
30
+ );
31
+ }
32
+
33
+ const libManifest = path.resolve('WebDriverAgentLib', 'Info.plist');
34
+ log.info(`Updating the WebDriverAgent manifest at '${libManifest}' to version '${newVersion}'`);
35
+ await plist.updatePlistFile(libManifest, {
36
+ CFBundleShortVersionString: newVersion,
37
+ CFBundleVersion: newVersion,
38
+ }, false);
39
+ }
40
+
41
+ (async () => await updateWdaVersion())();
42
+
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>10.5.3</string>
18
+ <string>11.0.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>10.5.3</string>
22
+ <string>11.0.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>