appium-xcuitest-driver 7.12.0 → 7.14.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.
package/lib/driver.js CHANGED
@@ -12,15 +12,12 @@ import EventEmitter from 'node:events';
12
12
  import path from 'node:path';
13
13
  import url from 'node:url';
14
14
  import {
15
- APP_EXT,
16
- IPA_EXT,
15
+ SUPPORTED_EXTENSIONS,
17
16
  SAFARI_BUNDLE_ID,
18
17
  extractBundleId,
19
18
  extractBundleVersion,
20
- fetchSupportedAppPlatforms,
21
- findApps,
22
- isAppBundle,
23
- isolateAppBundle,
19
+ onPostConfigureApp,
20
+ onDownloadApp,
24
21
  verifyApplicationPlatform,
25
22
  } from './app-utils';
26
23
  import commands from './commands';
@@ -70,8 +67,6 @@ import {
70
67
  const SHUTDOWN_OTHER_FEAT_NAME = 'shutdown_other_sims';
71
68
  const CUSTOMIZE_RESULT_BUNDLE_PATH = 'customize_result_bundle_path';
72
69
 
73
- const SUPPORTED_EXTENSIONS = [IPA_EXT, APP_EXT];
74
- const MAX_ARCHIVE_SCAN_DEPTH = 1;
75
70
  const defaultServerCaps = {
76
71
  webStorageEnabled: false,
77
72
  locationContextEnabled: false,
@@ -1065,107 +1060,12 @@ export class XCUITestDriver extends BaseDriver {
1065
1060
  }
1066
1061
 
1067
1062
  this.opts.app = await this.helpers.configureApp(this.opts.app, {
1068
- onPostProcess: this.onPostConfigureApp.bind(this),
1063
+ onPostProcess: onPostConfigureApp.bind(this),
1064
+ onDownload: onDownloadApp.bind(this),
1069
1065
  supportedExtensions: SUPPORTED_EXTENSIONS,
1070
1066
  });
1071
1067
  }
1072
1068
 
1073
- /**
1074
- * Unzip the given archive and find a matching .app bundle in it
1075
- *
1076
- * @param {string} appPath The path to the archive.
1077
- * @param {number} depth [0] the current nesting depth. App bundles whose nesting level
1078
- * is greater than 1 are not supported.
1079
- * @returns {Promise<string>} Full path to the first matching .app bundle..
1080
- * @throws If no matching .app bundles were found in the provided archive.
1081
- */
1082
- async unzipApp(appPath, depth = 0) {
1083
- if (depth > MAX_ARCHIVE_SCAN_DEPTH) {
1084
- throw new Error('Nesting of package bundles is not supported');
1085
- }
1086
- const [rootDir, matchedPaths] = await findApps(appPath, SUPPORTED_EXTENSIONS);
1087
- if (_.isEmpty(matchedPaths)) {
1088
- this.log.debug(`'${path.basename(appPath)}' has no bundles`);
1089
- } else {
1090
- this.log.debug(
1091
- `Found ${util.pluralize('bundle', matchedPaths.length, true)} in ` +
1092
- `'${path.basename(appPath)}': ${matchedPaths}`,
1093
- );
1094
- }
1095
- try {
1096
- for (const matchedPath of matchedPaths) {
1097
- const fullPath = path.join(rootDir, matchedPath);
1098
- if (await isAppBundle(fullPath)) {
1099
- const supportedPlatforms = await fetchSupportedAppPlatforms(fullPath);
1100
- if (this.isSimulator() && !supportedPlatforms.some((p) => _.includes(p, 'Simulator'))) {
1101
- this.log.info(
1102
- `'${matchedPath}' does not have Simulator devices in the list of supported platforms ` +
1103
- `(${supportedPlatforms.join(',')}). Skipping it`,
1104
- );
1105
- continue;
1106
- }
1107
- if (this.isRealDevice() && !supportedPlatforms.some((p) => _.includes(p, 'OS'))) {
1108
- this.log.info(
1109
- `'${matchedPath}' does not have real devices in the list of supported platforms ` +
1110
- `(${supportedPlatforms.join(',')}). Skipping it`,
1111
- );
1112
- continue;
1113
- }
1114
- this.log.info(
1115
- `'${matchedPath}' is the resulting application bundle selected from '${appPath}'`,
1116
- );
1117
- return await isolateAppBundle(fullPath);
1118
- } else if (_.endsWith(_.toLower(fullPath), IPA_EXT) && (await fs.stat(fullPath)).isFile()) {
1119
- try {
1120
- return await this.unzipApp(fullPath, depth + 1);
1121
- } catch (e) {
1122
- this.log.warn(`Skipping processing of '${matchedPath}': ${e.message}`);
1123
- }
1124
- }
1125
- }
1126
- } finally {
1127
- await fs.rimraf(rootDir);
1128
- }
1129
- throw new Error(
1130
- `${this.opts.app} did not have any matching ${APP_EXT} or ${IPA_EXT} ` +
1131
- `bundles. Please make sure the provided package is valid and contains at least one matching ` +
1132
- `application bundle which is not nested.`,
1133
- );
1134
- }
1135
-
1136
- async onPostConfigureApp({cachedAppInfo, isUrl, appPath}) {
1137
- // Pick the previously cached entry if its integrity has been preserved
1138
- if (
1139
- _.isPlainObject(cachedAppInfo) &&
1140
- (await fs.stat(appPath)).isFile() &&
1141
- (await fs.hash(appPath)) === cachedAppInfo.packageHash &&
1142
- (await fs.exists(cachedAppInfo.fullPath)) &&
1143
- (
1144
- await fs.glob('**/*', {
1145
- cwd: cachedAppInfo.fullPath,
1146
- })
1147
- ).length === cachedAppInfo.integrity.folder
1148
- ) {
1149
- this.log.info(`Using '${cachedAppInfo.fullPath}' which was cached from '${appPath}'`);
1150
- return {appPath: cachedAppInfo.fullPath};
1151
- }
1152
-
1153
- // Only local .app bundles that are available in-place should not be cached
1154
- if (await isAppBundle(appPath)) {
1155
- return false;
1156
- }
1157
-
1158
- // Extract the app bundle and cache it
1159
- try {
1160
- return {appPath: await this.unzipApp(appPath)};
1161
- } finally {
1162
- // Cleanup previously downloaded archive
1163
- if (isUrl) {
1164
- await fs.rimraf(appPath);
1165
- }
1166
- }
1167
- }
1168
-
1169
1069
  async determineDevice() {
1170
1070
  // in the one case where we create a sim, we will set this state
1171
1071
  this.lifecycleData.createSim = false;
@@ -1951,6 +1851,7 @@ export class XCUITestDriver extends BaseDriver {
1951
1851
  /** @deprecated */
1952
1852
  setValueImmediate = commands.elementExtensions.setValueImmediate;
1953
1853
  setValue = commands.elementExtensions.setValue;
1854
+ setValueWithWebAtom = commands.elementExtensions.setValueWithWebAtom;
1954
1855
  keys = commands.elementExtensions.keys;
1955
1856
  clear = commands.elementExtensions.clear;
1956
1857
  getContentSize = commands.elementExtensions.getContentSize;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appium-xcuitest-driver",
3
- "version": "7.12.0",
3
+ "version": "7.14.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appium-xcuitest-driver",
9
- "version": "7.12.0",
9
+ "version": "7.14.0",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@colors/colors": "^1.6.0",
@@ -83,16 +83,16 @@
83
83
  "npm": ">=8"
84
84
  },
85
85
  "peerDependencies": {
86
- "appium": "^2.4.1"
86
+ "appium": "^2.5.4"
87
87
  }
88
88
  },
89
89
  "node_modules/@appium/base-driver": {
90
- "version": "9.5.4",
91
- "resolved": "https://registry.npmjs.org/@appium/base-driver/-/base-driver-9.5.4.tgz",
92
- "integrity": "sha512-kYBYyfXu15RAvAaJ/FUR2gosm74E5Nl9N6A3AzX1SZVDqm7mLojSgBZCGrRsd/oMVE1vpMcwHWJt4JpYXkrbhw==",
90
+ "version": "9.6.0",
91
+ "resolved": "https://registry.npmjs.org/@appium/base-driver/-/base-driver-9.6.0.tgz",
92
+ "integrity": "sha512-8+pqWHQ4tbvtwOxNCtHa5m0SUwQIvAwHTVKq/YUbgDn18ep4nGhz5rlryvvqyNpXEgEOhbLInIRma1KIrYdX8Q==",
93
93
  "dependencies": {
94
- "@appium/support": "^4.2.4",
95
- "@appium/types": "^0.16.2",
94
+ "@appium/support": "^4.2.5",
95
+ "@appium/types": "^0.17.0",
96
96
  "@colors/colors": "1.6.0",
97
97
  "@types/async-lock": "1.4.2",
98
98
  "@types/bluebird": "3.5.42",
@@ -137,11 +137,11 @@
137
137
  }
138
138
  },
139
139
  "node_modules/@appium/docutils": {
140
- "version": "1.0.6",
141
- "resolved": "https://registry.npmjs.org/@appium/docutils/-/docutils-1.0.6.tgz",
142
- "integrity": "sha512-I7irwTyBlMfNPfhFAcNkGLsJdZxNvWXsbcgV/oW4PU5dBN0wfwqrfLJQrrfHGTDpgDukpaTl7J+Ro82WgATWfA==",
140
+ "version": "1.0.7",
141
+ "resolved": "https://registry.npmjs.org/@appium/docutils/-/docutils-1.0.7.tgz",
142
+ "integrity": "sha512-cuVcE3nNKlhJZsXrleubYkrr4VrEXaVKxq0GePb5+qmgpkx2OQb18imoPx1FKBlDbxHGrV7fuLxc/5LbmsV0dA==",
143
143
  "dependencies": {
144
- "@appium/support": "^4.2.4",
144
+ "@appium/support": "^4.2.5",
145
145
  "@appium/tsconfig": "^0.3.3",
146
146
  "@sliphua/lilconfig-ts-loader": "3.2.2",
147
147
  "@types/which": "3.0.3",
@@ -209,12 +209,12 @@
209
209
  }
210
210
  },
211
211
  "node_modules/@appium/support": {
212
- "version": "4.2.4",
213
- "resolved": "https://registry.npmjs.org/@appium/support/-/support-4.2.4.tgz",
214
- "integrity": "sha512-TfZ+sIm295EQzL89ympDwwWfuzRHnkiZv5SPDMBcrCJHXcJVcL7BhuQhkiPkHaZvNgKvyvcEb9kGNC+L2UtN+g==",
212
+ "version": "4.2.5",
213
+ "resolved": "https://registry.npmjs.org/@appium/support/-/support-4.2.5.tgz",
214
+ "integrity": "sha512-txTDZHjJF7UjEFi4uyj23gciz3yAq7OwzXFdJgtQBzkK1cIiCnywQ6igLmBg52jZp84ki8eZIDMXsQetVUuDDg==",
215
215
  "dependencies": {
216
216
  "@appium/tsconfig": "^0.3.3",
217
- "@appium/types": "^0.16.2",
217
+ "@appium/types": "^0.17.0",
218
218
  "@colors/colors": "1.6.0",
219
219
  "@types/archiver": "6.0.2",
220
220
  "@types/base64-stream": "1.0.5",
@@ -265,7 +265,7 @@
265
265
  "type-fest": "4.10.1",
266
266
  "uuid": "9.0.1",
267
267
  "which": "4.0.0",
268
- "yauzl": "3.1.2"
268
+ "yauzl": "3.1.3"
269
269
  },
270
270
  "engines": {
271
271
  "node": "^14.17.0 || ^16.13.0 || >=18.0.0",
@@ -299,9 +299,9 @@
299
299
  }
300
300
  },
301
301
  "node_modules/@appium/types": {
302
- "version": "0.16.2",
303
- "resolved": "https://registry.npmjs.org/@appium/types/-/types-0.16.2.tgz",
304
- "integrity": "sha512-4LpzS26hfTuK5rAXogotydMFjA0UdWKpQscpsIJKJQ3KGNYNNSQL0fpVcJ6hHHXA2/ySI6DtQeK9+ayUBCUqYg==",
302
+ "version": "0.17.0",
303
+ "resolved": "https://registry.npmjs.org/@appium/types/-/types-0.17.0.tgz",
304
+ "integrity": "sha512-7Q9C5Y4G8ZQzdU0uJIlfVqpGMAzNqdXpNWziQTUfZyD7fHbYz9ScZrlgs2/DYMITRrHiIblmzY/5yzfu00rQuA==",
305
305
  "dependencies": {
306
306
  "@appium/schema": "^0.5.0",
307
307
  "@appium/tsconfig": "^0.3.3",
@@ -922,9 +922,9 @@
922
922
  }
923
923
  },
924
924
  "node_modules/appium-remote-debugger": {
925
- "version": "11.1.0",
926
- "resolved": "https://registry.npmjs.org/appium-remote-debugger/-/appium-remote-debugger-11.1.0.tgz",
927
- "integrity": "sha512-Hexj1V8e7BnnfhfDbUU+jDOd6ChK8lSZktm8eXXfaobABXo/0/pkfoyo6S5Gt/o9bmualQOLzjcsEWJOJEedtg==",
925
+ "version": "11.1.1",
926
+ "resolved": "https://registry.npmjs.org/appium-remote-debugger/-/appium-remote-debugger-11.1.1.tgz",
927
+ "integrity": "sha512-Fcu3U6mQtWBq+zQDb1fhnxoVTyZ5cmPi+dpM6zy+eVbYk/nR9n20v4uOQstH2ySnAknpNGVMSQVPBoZOP+YS2Q==",
928
928
  "dependencies": {
929
929
  "@appium/base-driver": "^9.0.0",
930
930
  "@appium/support": "^4.0.0",
@@ -944,9 +944,9 @@
944
944
  }
945
945
  },
946
946
  "node_modules/appium-webdriveragent": {
947
- "version": "8.5.2",
948
- "resolved": "https://registry.npmjs.org/appium-webdriveragent/-/appium-webdriveragent-8.5.2.tgz",
949
- "integrity": "sha512-v7DfnS9sN4KD6ahAOixGF90ajJUZADYim9mxOSIH2Qs3hX/KHURbHD9khQJp5Kbu0jeIpmaLj+yXpbtAg8c+9g==",
947
+ "version": "8.5.6",
948
+ "resolved": "https://registry.npmjs.org/appium-webdriveragent/-/appium-webdriveragent-8.5.6.tgz",
949
+ "integrity": "sha512-9cfqCfgQ4RmVI66jWuw71Xf1u9EErVaB8KVDGMtOaYxpS3QH6DoGRTWDEzUfmhvOfOZg0mtkHnh4WM1fvscI7w==",
950
950
  "dependencies": {
951
951
  "@appium/base-driver": "^9.0.0",
952
952
  "@appium/strongbox": "^0.x",
@@ -4217,9 +4217,9 @@
4217
4217
  }
4218
4218
  },
4219
4219
  "node_modules/yauzl": {
4220
- "version": "3.1.2",
4221
- "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.1.2.tgz",
4222
- "integrity": "sha512-621iCPgEG1wXViDZS/L3h9F8TgrdQV1eayJlJ8j5A2SZg8OdY/1DLf+VxNeD+q5QbMFEAbjjR8nITj7g4nKa0Q==",
4220
+ "version": "3.1.3",
4221
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.1.3.tgz",
4222
+ "integrity": "sha512-JCCdmlJJWv7L0q/KylOekyRaUrdEoUxWkWVcgorosTROCFWiS9p2NNPE9Yb91ak7b1N5SxAZEliWpspbZccivw==",
4223
4223
  "dependencies": {
4224
4224
  "buffer-crc32": "~0.2.3",
4225
4225
  "pend": "~1.2.0"
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "xcuitest",
9
9
  "xctest"
10
10
  ],
11
- "version": "7.12.0",
11
+ "version": "7.14.0",
12
12
  "author": "Appium Contributors",
13
13
  "license": "Apache-2.0",
14
14
  "repository": {
@@ -131,7 +131,7 @@
131
131
  "singleQuote": true
132
132
  },
133
133
  "peerDependencies": {
134
- "appium": "^2.4.1"
134
+ "appium": "^2.5.4"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@appium/docutils": "^1.0.2",