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.
- package/CHANGELOG.md +12 -0
- package/Scripts/build-webdriveragent.mjs +8 -9
- package/Scripts/fetch-prebuilt-wda.mjs +16 -14
- package/Scripts/update-wda-version.mjs +12 -10
- package/WebDriverAgentLib/Info.plist +2 -2
- package/build/lib/check-dependencies.d.ts.map +1 -1
- package/build/lib/check-dependencies.js +1 -1
- package/build/lib/check-dependencies.js.map +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils/index.d.ts +1 -1
- package/build/lib/utils/index.d.ts.map +1 -1
- package/build/lib/utils/index.js +1 -1
- package/build/lib/utils/index.js.map +1 -1
- package/build/lib/utils/module.d.ts.map +1 -1
- package/build/lib/utils/module.js +1 -1
- package/build/lib/utils/module.js.map +1 -1
- package/build/lib/utils/processes.d.ts.map +1 -1
- package/build/lib/utils/processes.js.map +1 -1
- package/build/lib/utils/security.d.ts.map +1 -1
- package/build/lib/utils/security.js.map +1 -1
- package/build/lib/utils/xctestrun.d.ts.map +1 -1
- package/build/lib/utils/xctestrun.js +4 -6
- package/build/lib/utils/xctestrun.js.map +1 -1
- package/build/lib/wda-strategies.d.ts +1 -1
- package/build/lib/wda-strategies.d.ts.map +1 -1
- package/build/lib/wda-strategies.js +3 -4
- package/build/lib/wda-strategies.js.map +1 -1
- package/build/lib/webdriveragent.d.ts +1 -1
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js +6 -7
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.d.ts +1 -1
- package/build/lib/xcodebuild.d.ts.map +1 -1
- package/build/lib/xcodebuild.js +7 -14
- package/build/lib/xcodebuild.js.map +1 -1
- package/lib/check-dependencies.ts +4 -8
- package/lib/types.ts +5 -3
- package/lib/utils/index.ts +1 -6
- package/lib/utils/module.ts +3 -5
- package/lib/utils/processes.ts +2 -3
- package/lib/utils/security.ts +2 -4
- package/lib/utils/xctestrun.ts +8 -21
- package/lib/wda-strategies.ts +8 -15
- package/lib/webdriveragent.ts +19 -34
- package/lib/xcodebuild.ts +18 -44
- package/package.json +56 -66
package/lib/xcodebuild.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "16.0.2",
|
|
4
4
|
"description": "Package bundling WebDriverAgent",
|
|
5
|
-
"
|
|
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": "
|
|
20
|
-
"lint:fix": "
|
|
21
|
-
"format": "
|
|
22
|
-
"format:check": "
|
|
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
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
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/
|
|
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": "^
|
|
69
|
-
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
83
|
+
"appium-xcode": "^7.0.0",
|
|
70
84
|
"esmock": "^2.7.6",
|
|
71
|
-
"node-simctl": "^
|
|
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
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
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
|
}
|