appium-webdriveragent 12.2.2 → 13.1.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/CHANGELOG.md +20 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +6 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme +18 -0
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
- package/WebDriverAgentRunner/Assets.xcassets/Contents.json +6 -0
- package/build/lib/index.d.ts +1 -1
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +2 -1
- package/build/lib/index.js.map +1 -1
- package/build/lib/types.d.ts +23 -3
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/webdriveragent.d.ts +11 -23
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js +39 -100
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.d.ts +12 -9
- package/build/lib/xcodebuild.d.ts.map +1 -1
- package/build/lib/xcodebuild.js +80 -33
- package/build/lib/xcodebuild.js.map +1 -1
- package/lib/index.ts +1 -1
- package/lib/types.ts +33 -3
- package/lib/webdriveragent.ts +52 -112
- package/lib/xcodebuild.ts +104 -36
- package/package.json +2 -2
- package/lib/appium-ios-device.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [13.1.0](https://github.com/appium/WebDriverAgent/compare/v13.0.0...v13.1.0) (2026-05-21)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add app icon to WebDriverAgentRunner ([#1138](https://github.com/appium/WebDriverAgent/issues/1138)) ([fe8adc8](https://github.com/appium/WebDriverAgent/commit/fe8adc89923994428783397170de850e11ebb3c6))
|
|
6
|
+
* Add helper method to fetch build settings ([#1139](https://github.com/appium/WebDriverAgent/issues/1139)) ([56b5f38](https://github.com/appium/WebDriverAgent/commit/56b5f384ed9ba1a014d4b642ddf26b8573ceaafe))
|
|
7
|
+
|
|
8
|
+
## [13.0.0](https://github.com/appium/WebDriverAgent/compare/v12.2.2...v13.0.0) (2026-05-17)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* quitAndUninstall() removed — use quit() only. App uninstall is out of scope for this module.
|
|
13
|
+
* uninstall() removed — WDA must not be uninstalled from this package; callers (e.g. xcuitest-driver) should own that if needed.
|
|
14
|
+
* setupCaching() no longer uninstalls WDA — on bundle-id or version mismatch it logs and skips caching instead of removing apps from the device. Also, it now returns the cached url on success.
|
|
15
|
+
* appium-ios-device dependency removed — preinstalled WDA on real devices always launches via devicectl (no iOS < 17 Xctest fallback).
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Drop legacy APIs ([#1137](https://github.com/appium/WebDriverAgent/issues/1137)) ([8995d24](https://github.com/appium/WebDriverAgent/commit/8995d24e16634a4624918319996839993502c7b4))
|
|
20
|
+
|
|
1
21
|
## [12.2.2](https://github.com/appium/WebDriverAgent/compare/v12.2.1...v12.2.2) (2026-05-08)
|
|
2
22
|
|
|
3
23
|
### Bug Fixes
|
|
@@ -826,6 +826,7 @@
|
|
|
826
826
|
F59CD6D52EF16E5E00F91287 /* XCUIElement+FBCustomActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F59CD6D32EF16E5E00F91287 /* XCUIElement+FBCustomActions.m */; };
|
|
827
827
|
F59CD6D62EF16E5E00F91287 /* XCUIElement+FBCustomActions.h in Headers */ = {isa = PBXBuildFile; fileRef = F59CD6D22EF16E5E00F91287 /* XCUIElement+FBCustomActions.h */; };
|
|
828
828
|
F59CD6D72EF16E5E00F91287 /* XCUIElement+FBCustomActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F59CD6D32EF16E5E00F91287 /* XCUIElement+FBCustomActions.m */; };
|
|
829
|
+
A1B2C3D4E5F600000000001B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1B2C3D4E5F600000000001A /* Assets.xcassets */; };
|
|
829
830
|
/* End PBXBuildFile section */
|
|
830
831
|
|
|
831
832
|
/* Begin PBXContainerItemProxy section */
|
|
@@ -1368,6 +1369,7 @@
|
|
|
1368
1369
|
EE9AB7921CAEDF0C008C271F /* FBRuntimeUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBRuntimeUtils.m; sourceTree = "<group>"; };
|
|
1369
1370
|
EE9AB7FC1CAEE048008C271F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = WebDriverAgentRunner/Info.plist; sourceTree = SOURCE_ROOT; };
|
|
1370
1371
|
EE9AB7FD1CAEE048008C271F /* UITestingUITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UITestingUITests.m; path = WebDriverAgentRunner/UITestingUITests.m; sourceTree = SOURCE_ROOT; };
|
|
1372
|
+
A1B2C3D4E5F600000000001A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = WebDriverAgentRunner/Assets.xcassets; sourceTree = SOURCE_ROOT; };
|
|
1371
1373
|
EE9AB8031CAEE182008C271F /* build.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
|
|
1372
1374
|
EE9B75D41CF7956C00275851 /* IntegrationApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IntegrationApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
1373
1375
|
EE9B75EC1CF7956C00275851 /* IntegrationTests_1.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IntegrationTests_1.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
@@ -2294,6 +2296,7 @@
|
|
|
2294
2296
|
children = (
|
|
2295
2297
|
EE9AB7FC1CAEE048008C271F /* Info.plist */,
|
|
2296
2298
|
EE9AB7FD1CAEE048008C271F /* UITestingUITests.m */,
|
|
2299
|
+
A1B2C3D4E5F600000000001A /* Assets.xcassets */,
|
|
2297
2300
|
);
|
|
2298
2301
|
name = WebDriverAgentRunner;
|
|
2299
2302
|
path = XCTUITestRunner;
|
|
@@ -3110,6 +3113,7 @@
|
|
|
3110
3113
|
isa = PBXResourcesBuildPhase;
|
|
3111
3114
|
buildActionMask = 2147483647;
|
|
3112
3115
|
files = (
|
|
3116
|
+
A1B2C3D4E5F600000000001B /* Assets.xcassets in Resources */,
|
|
3113
3117
|
);
|
|
3114
3118
|
runOnlyForDeploymentPostprocessing = 0;
|
|
3115
3119
|
};
|
|
@@ -4346,6 +4350,7 @@
|
|
|
4346
4350
|
isa = XCBuildConfiguration;
|
|
4347
4351
|
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
|
|
4348
4352
|
buildSettings = {
|
|
4353
|
+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
4349
4354
|
CLANG_STATIC_ANALYZER_MODE = deep;
|
|
4350
4355
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
4351
4356
|
ENABLE_TESTING_SEARCH_PATHS = YES;
|
|
@@ -4399,6 +4404,7 @@
|
|
|
4399
4404
|
isa = XCBuildConfiguration;
|
|
4400
4405
|
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
|
|
4401
4406
|
buildSettings = {
|
|
4407
|
+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
4402
4408
|
CLANG_STATIC_ANALYZER_MODE = deep;
|
|
4403
4409
|
ENABLE_TESTING_SEARCH_PATHS = YES;
|
|
4404
4410
|
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
|
@@ -5,6 +5,24 @@
|
|
|
5
5
|
<BuildAction
|
|
6
6
|
parallelizeBuildables = "YES"
|
|
7
7
|
buildImplicitDependencies = "YES">
|
|
8
|
+
<PostActions>
|
|
9
|
+
<ExecutionAction
|
|
10
|
+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
|
11
|
+
<ActionContent
|
|
12
|
+
title = "Embed app icon into Runner.app"
|
|
13
|
+
scriptText = ""${SRCROOT}/Scripts/embed-runner-icon.sh" ">
|
|
14
|
+
<EnvironmentBuildable>
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "EEF988291C486603005CA669"
|
|
18
|
+
BuildableName = "WebDriverAgentRunner.xctest"
|
|
19
|
+
BlueprintName = "WebDriverAgentRunner"
|
|
20
|
+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</EnvironmentBuildable>
|
|
23
|
+
</ActionContent>
|
|
24
|
+
</ExecutionAction>
|
|
25
|
+
</PostActions>
|
|
8
26
|
<BuildActionEntries>
|
|
9
27
|
<BuildActionEntry
|
|
10
28
|
buildForTesting = "YES"
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>
|
|
18
|
+
<string>13.1.0</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>
|
|
22
|
+
<string>13.1.0</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
package/build/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { bundleWDASim } from './check-dependencies';
|
|
2
2
|
export { NoSessionProxy } from './no-session-proxy';
|
|
3
3
|
export { WebDriverAgent } from './webdriveragent';
|
|
4
|
-
export { WDA_BASE_URL, WDA_RUNNER_BUNDLE_ID, PROJECT_FILE } from './constants';
|
|
4
|
+
export { WDA_BASE_URL, WDA_RUNNER_APP, WDA_RUNNER_BUNDLE_ID, PROJECT_FILE } from './constants';
|
|
5
5
|
export { resetTestProcesses, BOOTSTRAP_PATH } from './utils';
|
|
6
6
|
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/build/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAE3D,cAAc,SAAS,CAAC"}
|
package/build/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.BOOTSTRAP_PATH = exports.resetTestProcesses = exports.PROJECT_FILE = exports.WDA_RUNNER_BUNDLE_ID = exports.WDA_BASE_URL = exports.WebDriverAgent = exports.NoSessionProxy = exports.bundleWDASim = void 0;
|
|
17
|
+
exports.BOOTSTRAP_PATH = exports.resetTestProcesses = exports.PROJECT_FILE = exports.WDA_RUNNER_BUNDLE_ID = exports.WDA_RUNNER_APP = exports.WDA_BASE_URL = exports.WebDriverAgent = exports.NoSessionProxy = exports.bundleWDASim = void 0;
|
|
18
18
|
var check_dependencies_1 = require("./check-dependencies");
|
|
19
19
|
Object.defineProperty(exports, "bundleWDASim", { enumerable: true, get: function () { return check_dependencies_1.bundleWDASim; } });
|
|
20
20
|
var no_session_proxy_1 = require("./no-session-proxy");
|
|
@@ -23,6 +23,7 @@ var webdriveragent_1 = require("./webdriveragent");
|
|
|
23
23
|
Object.defineProperty(exports, "WebDriverAgent", { enumerable: true, get: function () { return webdriveragent_1.WebDriverAgent; } });
|
|
24
24
|
var constants_1 = require("./constants");
|
|
25
25
|
Object.defineProperty(exports, "WDA_BASE_URL", { enumerable: true, get: function () { return constants_1.WDA_BASE_URL; } });
|
|
26
|
+
Object.defineProperty(exports, "WDA_RUNNER_APP", { enumerable: true, get: function () { return constants_1.WDA_RUNNER_APP; } });
|
|
26
27
|
Object.defineProperty(exports, "WDA_RUNNER_BUNDLE_ID", { enumerable: true, get: function () { return constants_1.WDA_RUNNER_BUNDLE_ID; } });
|
|
27
28
|
Object.defineProperty(exports, "PROJECT_FILE", { enumerable: true, get: function () { return constants_1.PROJECT_FILE; } });
|
|
28
29
|
var utils_1 = require("./utils");
|
package/build/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAkD;AAA1C,kHAAA,YAAY,OAAA;AACpB,uDAAkD;AAA1C,kHAAA,cAAc,OAAA;AACtB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAkD;AAA1C,kHAAA,YAAY,OAAA;AACpB,uDAAkD;AAA1C,kHAAA,cAAc,OAAA;AACtB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,yCAA6F;AAArF,yGAAA,YAAY,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AACxE,iCAA2D;AAAnD,2GAAA,kBAAkB,OAAA;AAAE,uGAAA,cAAc,OAAA;AAE1C,0CAAwB"}
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type HTTPHeaders } from '@appium/types';
|
|
2
|
+
import type { Simctl } from 'node-simctl';
|
|
3
|
+
import type { Devicectl } from 'node-devicectl';
|
|
2
4
|
export interface WDASettings {
|
|
3
5
|
elementResponseAttribute?: string;
|
|
4
6
|
shouldUseCompactResponses?: boolean;
|
|
@@ -88,9 +90,8 @@ export interface WebDriverAgentArgs {
|
|
|
88
90
|
}
|
|
89
91
|
export interface AppleDevice {
|
|
90
92
|
udid: string;
|
|
91
|
-
simctl?:
|
|
92
|
-
devicectl?:
|
|
93
|
-
[key: string]: any;
|
|
93
|
+
simctl?: Simctl;
|
|
94
|
+
devicectl?: Devicectl;
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
96
97
|
* Information of the device under test
|
|
@@ -101,6 +102,25 @@ export interface DeviceInfo {
|
|
|
101
102
|
platformVersion: string;
|
|
102
103
|
platformName: string;
|
|
103
104
|
}
|
|
105
|
+
/** Xcode build setting key/value pairs from `xcodebuild -showBuildSettings -json`. */
|
|
106
|
+
export type XcodeBuildSettings = Record<string, string>;
|
|
107
|
+
/** A single target entry returned by `xcodebuild -showBuildSettings -json`. */
|
|
108
|
+
export interface XcodeShowBuildSettingsEntry {
|
|
109
|
+
action: string;
|
|
110
|
+
buildSettings: XcodeBuildSettings;
|
|
111
|
+
target: string;
|
|
112
|
+
}
|
|
113
|
+
export type WdaScheme = 'WebDriverAgentRunner' | 'WebDriverAgentLib' | 'WebDriverAgentRunner_tvOS' | 'WebDriverAgentLib_tvOS';
|
|
114
|
+
export type WdaSdk = 'iphonesimulator' | 'iphoneos' | 'appletvsimulator' | 'appletvos';
|
|
115
|
+
export type WdaBuildConfiguration = 'Debug' | 'Release';
|
|
116
|
+
/** Options passed to {@link XcodeBuild.retrieveBuildSettings}. */
|
|
117
|
+
export interface RetrieveBuildSettingsOptions {
|
|
118
|
+
scheme?: WdaScheme;
|
|
119
|
+
sdk?: WdaSdk;
|
|
120
|
+
configuration?: WdaBuildConfiguration;
|
|
121
|
+
/** `-destination` value (e.g. `id=<udid>` or a full destination specifier). */
|
|
122
|
+
destination?: string;
|
|
123
|
+
}
|
|
104
124
|
export interface XcodeBuildArgs {
|
|
105
125
|
realDevice: boolean;
|
|
106
126
|
agentPath: string;
|
package/build/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,WAAW;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IACl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C,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC,CAAC,EAAE,OAAO,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,WAAW,CAAC;CACnC"}
|
|
@@ -2,7 +2,7 @@ import { JWProxy } from '@appium/base-driver';
|
|
|
2
2
|
import type { AppiumLogger, StringRecord } from '@appium/types';
|
|
3
3
|
import { NoSessionProxy } from './no-session-proxy';
|
|
4
4
|
import { XcodeBuild } from './xcodebuild';
|
|
5
|
-
import type { WebDriverAgentArgs, AppleDevice } from './types';
|
|
5
|
+
import type { WebDriverAgentArgs, AppleDevice, XcodeBuildSettings, RetrieveBuildSettingsOptions } from './types';
|
|
6
6
|
export declare class WebDriverAgent {
|
|
7
7
|
bootstrapPath: string;
|
|
8
8
|
agentPath: string;
|
|
@@ -23,18 +23,15 @@ export declare class WebDriverAgent {
|
|
|
23
23
|
jwproxy?: JWProxy;
|
|
24
24
|
proxyReqRes?: any;
|
|
25
25
|
private readonly log;
|
|
26
|
-
private readonly wdaBundlePath?;
|
|
27
26
|
private readonly wdaLocalPort?;
|
|
28
27
|
private readonly prebuildWDA?;
|
|
29
28
|
private readonly wdaConnectionTimeout?;
|
|
30
29
|
private readonly useXctestrunFile?;
|
|
31
30
|
private readonly usePrebuiltWDA?;
|
|
32
|
-
private readonly derivedDataPath?;
|
|
33
31
|
private readonly mjpegServerPort?;
|
|
34
32
|
private readonly wdaLaunchTimeout;
|
|
35
33
|
private readonly usePreinstalledWDA?;
|
|
36
34
|
private readonly updatedWDABundleIdSuffix;
|
|
37
|
-
private xctestApiClient?;
|
|
38
35
|
private _xcodebuild?;
|
|
39
36
|
private _url?;
|
|
40
37
|
/**
|
|
@@ -132,26 +129,26 @@ export declare class WebDriverAgent {
|
|
|
132
129
|
*/
|
|
133
130
|
quit(): Promise<void>;
|
|
134
131
|
/**
|
|
135
|
-
* Retrieves
|
|
132
|
+
* Retrieves Xcode build settings.
|
|
133
|
+
* @param options - Optional scheme, SDK, configuration, or destination
|
|
134
|
+
* @returns Build settings, or `undefined` if xcodebuild is skipped or settings cannot be determined
|
|
135
|
+
*/
|
|
136
|
+
retrieveBuildSettings(options?: RetrieveBuildSettingsOptions): Promise<XcodeBuildSettings | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated Use {@link retrieveBuildSettings} instead. Will be removed in a future release.
|
|
136
139
|
* @returns The derived data path, or `undefined` if xcodebuild is skipped
|
|
137
140
|
*/
|
|
138
141
|
retrieveDerivedDataPath(): Promise<string | undefined>;
|
|
139
142
|
/**
|
|
140
143
|
* Reuse running WDA if it has the same bundle id with updatedWDABundleId.
|
|
141
144
|
* Or reuse it if it has the default id without updatedWDABundleId.
|
|
142
|
-
*
|
|
143
|
-
|
|
144
|
-
setupCaching(): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Quit and uninstall running WDA.
|
|
145
|
+
*
|
|
146
|
+
* @returns The WDA URL used for caching on success, or `undefined` if caching was skipped.
|
|
147
147
|
*/
|
|
148
|
-
|
|
149
|
-
private parseBundleId;
|
|
150
|
-
private fetchWDABundle;
|
|
148
|
+
setupCaching(): Promise<string | undefined>;
|
|
151
149
|
private setupProxies;
|
|
152
150
|
private toUrl;
|
|
153
151
|
private setWDAPaths;
|
|
154
|
-
private isRunning;
|
|
155
152
|
/**
|
|
156
153
|
* Return current running WDA's status like below
|
|
157
154
|
* {
|
|
@@ -174,12 +171,6 @@ export declare class WebDriverAgent {
|
|
|
174
171
|
* @param timeoutMs If zero or negative, returns immediately. Otherwise, waits up to timeoutMs.
|
|
175
172
|
*/
|
|
176
173
|
private getStatus;
|
|
177
|
-
/**
|
|
178
|
-
* Uninstall WDAs from the test device.
|
|
179
|
-
* Over Xcode 11, multiple WDA can be in the device since Xcode 11 generates different WDA.
|
|
180
|
-
* Appium does not expect multiple WDAs are running on a device.
|
|
181
|
-
*/
|
|
182
|
-
private uninstall;
|
|
183
174
|
private _cleanupProjectIfFresh;
|
|
184
175
|
/**
|
|
185
176
|
* Launch WDA with preinstalled package with 'xcrun devicectl device process launch'.
|
|
@@ -187,9 +178,6 @@ export declare class WebDriverAgent {
|
|
|
187
178
|
* https://github.com/appium/WebDriverAgent/releases
|
|
188
179
|
* with proper sign for this case.
|
|
189
180
|
*
|
|
190
|
-
* When we implement launching XCTest service via appium-ios-device,
|
|
191
|
-
* this implementation can be replaced with it.
|
|
192
|
-
*
|
|
193
181
|
* @param opts launching WDA with devicectl command options.
|
|
194
182
|
*/
|
|
195
183
|
private _launchViaDevicectl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webdriveragent.d.ts","sourceRoot":"","sources":["../../lib/webdriveragent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAOlD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"webdriveragent.d.ts","sourceRoot":"","sources":["../../lib/webdriveragent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAOlD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAUxC,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAUjB,qBAAa,cAAc;IACzB,aAAa,EAAG,MAAM,CAAC;I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S;YAoDT,sBAAsB;IAmEpC;;;;;;;OAOG;YACW,mBAAmB;IAWjC;;;OAGG;YACW,yBAAyB;CAmCxC"}
|
|
@@ -14,13 +14,10 @@ const utils_1 = require("./utils");
|
|
|
14
14
|
const xcodebuild_1 = require("./xcodebuild");
|
|
15
15
|
const async_lock_1 = __importDefault(require("async-lock"));
|
|
16
16
|
const teen_process_1 = require("teen_process");
|
|
17
|
-
const check_dependencies_1 = require("./check-dependencies");
|
|
18
17
|
const constants_1 = require("./constants");
|
|
19
|
-
const appium_ios_device_1 = require("appium-ios-device");
|
|
20
18
|
const strongbox_1 = require("@appium/strongbox");
|
|
21
19
|
const WDA_LAUNCH_TIMEOUT = 60 * 1000;
|
|
22
20
|
const WDA_AGENT_PORT = 8100;
|
|
23
|
-
const WDA_CF_BUNDLE_NAME = 'WebDriverAgentRunner-Runner';
|
|
24
21
|
const SHARED_RESOURCES_GUARD = new async_lock_1.default();
|
|
25
22
|
const RECENT_MODULE_VERSION_ITEM_NAME = 'recentWdaModuleVersion';
|
|
26
23
|
const URL_PROTOCOL_SEPARATOR = '://';
|
|
@@ -44,18 +41,15 @@ class WebDriverAgent {
|
|
|
44
41
|
jwproxy;
|
|
45
42
|
proxyReqRes;
|
|
46
43
|
log;
|
|
47
|
-
wdaBundlePath;
|
|
48
44
|
wdaLocalPort;
|
|
49
45
|
prebuildWDA;
|
|
50
46
|
wdaConnectionTimeout;
|
|
51
47
|
useXctestrunFile;
|
|
52
48
|
usePrebuiltWDA;
|
|
53
|
-
derivedDataPath;
|
|
54
49
|
mjpegServerPort;
|
|
55
50
|
wdaLaunchTimeout;
|
|
56
51
|
usePreinstalledWDA;
|
|
57
52
|
updatedWDABundleIdSuffix;
|
|
58
|
-
xctestApiClient;
|
|
59
53
|
_xcodebuild;
|
|
60
54
|
_url;
|
|
61
55
|
/**
|
|
@@ -72,7 +66,6 @@ class WebDriverAgent {
|
|
|
72
66
|
this.iosSdkVersion = args.iosSdkVersion;
|
|
73
67
|
this.host = args.host;
|
|
74
68
|
this.isRealDevice = !!args.realDevice;
|
|
75
|
-
this.wdaBundlePath = args.wdaBundlePath;
|
|
76
69
|
this.setWDAPaths(args.bootstrapPath, args.agentPath);
|
|
77
70
|
this.wdaLocalPort = args.wdaLocalPort;
|
|
78
71
|
this.wdaRemotePort =
|
|
@@ -88,12 +81,10 @@ class WebDriverAgent {
|
|
|
88
81
|
this.wdaConnectionTimeout = args.wdaConnectionTimeout;
|
|
89
82
|
this.useXctestrunFile = args.useXctestrunFile;
|
|
90
83
|
this.usePrebuiltWDA = args.usePrebuiltWDA;
|
|
91
|
-
this.derivedDataPath = args.derivedDataPath;
|
|
92
84
|
this.mjpegServerPort = args.mjpegServerPort;
|
|
93
85
|
this.updatedWDABundleId = args.updatedWDABundleId;
|
|
94
86
|
this.wdaLaunchTimeout = args.wdaLaunchTimeout || WDA_LAUNCH_TIMEOUT;
|
|
95
87
|
this.usePreinstalledWDA = args.usePreinstalledWDA;
|
|
96
|
-
this.xctestApiClient = null;
|
|
97
88
|
this.updatedWDABundleIdSuffix = args.updatedWDABundleIdSuffix ?? constants_1.DEFAULT_TEST_BUNDLE_SUFFIX;
|
|
98
89
|
this._xcodebuild = this.canSkipXcodebuild
|
|
99
90
|
? null
|
|
@@ -304,18 +295,17 @@ class WebDriverAgent {
|
|
|
304
295
|
async quit() {
|
|
305
296
|
if (this.usePreinstalledWDA) {
|
|
306
297
|
this.log.info('Stopping the XCTest session');
|
|
307
|
-
|
|
308
|
-
this.
|
|
309
|
-
this.xctestApiClient = null;
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
try {
|
|
298
|
+
try {
|
|
299
|
+
if (this.device.simctl) {
|
|
313
300
|
await this.device.simctl.terminateApp(this.bundleIdForXctest);
|
|
314
301
|
}
|
|
315
|
-
|
|
316
|
-
this.
|
|
302
|
+
else if (this.device.devicectl) {
|
|
303
|
+
await this.device.devicectl.terminateApp(this.bundleIdForXctest);
|
|
317
304
|
}
|
|
318
305
|
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
this.log.warn(e.message);
|
|
308
|
+
}
|
|
319
309
|
}
|
|
320
310
|
else if (!this.args.webDriverAgentUrl) {
|
|
321
311
|
this.log.info('Shutting down sub-processes');
|
|
@@ -324,8 +314,7 @@ class WebDriverAgent {
|
|
|
324
314
|
}
|
|
325
315
|
}
|
|
326
316
|
else {
|
|
327
|
-
this.log.debug('
|
|
328
|
-
'since the WDA session is managed by outside this driver.');
|
|
317
|
+
this.log.debug('Stopping neither xcodebuild nor XCTest session since WDA lifecycle is not managed by this driver');
|
|
329
318
|
}
|
|
330
319
|
if (this.jwproxy) {
|
|
331
320
|
this.jwproxy.sessionId = null;
|
|
@@ -338,7 +327,18 @@ class WebDriverAgent {
|
|
|
338
327
|
}
|
|
339
328
|
}
|
|
340
329
|
/**
|
|
341
|
-
* Retrieves
|
|
330
|
+
* Retrieves Xcode build settings.
|
|
331
|
+
* @param options - Optional scheme, SDK, configuration, or destination
|
|
332
|
+
* @returns Build settings, or `undefined` if xcodebuild is skipped or settings cannot be determined
|
|
333
|
+
*/
|
|
334
|
+
async retrieveBuildSettings(options) {
|
|
335
|
+
if (this.canSkipXcodebuild) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
return await this.xcodebuild.retrieveBuildSettings(options);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* @deprecated Use {@link retrieveBuildSettings} instead. Will be removed in a future release.
|
|
342
342
|
* @returns The derived data path, or `undefined` if xcodebuild is skipped
|
|
343
343
|
*/
|
|
344
344
|
async retrieveDerivedDataPath() {
|
|
@@ -350,28 +350,29 @@ class WebDriverAgent {
|
|
|
350
350
|
/**
|
|
351
351
|
* Reuse running WDA if it has the same bundle id with updatedWDABundleId.
|
|
352
352
|
* Or reuse it if it has the default id without updatedWDABundleId.
|
|
353
|
-
*
|
|
353
|
+
*
|
|
354
|
+
* @returns The WDA URL used for caching on success, or `undefined` if caching was skipped.
|
|
354
355
|
*/
|
|
355
356
|
async setupCaching() {
|
|
356
357
|
const status = await this.getStatus(0);
|
|
357
358
|
if (!status || !status.build) {
|
|
358
359
|
this.log.debug('WDA is currently not running. There is nothing to cache');
|
|
359
|
-
return;
|
|
360
|
+
return undefined;
|
|
360
361
|
}
|
|
361
362
|
const { productBundleIdentifier, upgradedAt } = status.build;
|
|
362
363
|
// for real device
|
|
363
364
|
if (support_1.util.hasValue(productBundleIdentifier) &&
|
|
364
365
|
support_1.util.hasValue(this.updatedWDABundleId) &&
|
|
365
366
|
this.updatedWDABundleId !== productBundleIdentifier) {
|
|
366
|
-
this.log.info(`Will
|
|
367
|
-
return
|
|
367
|
+
this.log.info(`Will not reuse running WDA since it has different bundle id. The actual value is '${productBundleIdentifier}'.`);
|
|
368
|
+
return undefined;
|
|
368
369
|
}
|
|
369
370
|
// for simulator
|
|
370
371
|
if (support_1.util.hasValue(productBundleIdentifier) &&
|
|
371
372
|
!support_1.util.hasValue(this.updatedWDABundleId) &&
|
|
372
373
|
constants_1.WDA_RUNNER_BUNDLE_ID !== productBundleIdentifier) {
|
|
373
|
-
this.log.info(`Will
|
|
374
|
-
return
|
|
374
|
+
this.log.info(`Will not reuse running WDA since its bundle id is not equal to the default value ${constants_1.WDA_RUNNER_BUNDLE_ID}`);
|
|
375
|
+
return undefined;
|
|
375
376
|
}
|
|
376
377
|
const actualUpgradeTimestamp = await (0, utils_1.getWDAUpgradeTimestamp)();
|
|
377
378
|
this.log.debug(`Upgrade timestamp of the currently bundled WDA: ${actualUpgradeTimestamp}`);
|
|
@@ -379,42 +380,17 @@ class WebDriverAgent {
|
|
|
379
380
|
if (actualUpgradeTimestamp &&
|
|
380
381
|
upgradedAt &&
|
|
381
382
|
`${actualUpgradeTimestamp}`.toLowerCase() !== `${upgradedAt}`.toLowerCase()) {
|
|
382
|
-
this.log.info('Will
|
|
383
|
+
this.log.info('Will not reuse running WDA since it has different version in comparison to the one ' +
|
|
383
384
|
`which is bundled with appium-xcuitest-driver module (${actualUpgradeTimestamp} != ${upgradedAt})`);
|
|
384
|
-
return
|
|
385
|
+
return undefined;
|
|
385
386
|
}
|
|
387
|
+
const cachedUrl = this.url.href;
|
|
386
388
|
const message = support_1.util.hasValue(productBundleIdentifier)
|
|
387
|
-
? `Will reuse previously cached WDA instance at '${
|
|
388
|
-
: `Will reuse previously cached WDA instance at '${
|
|
389
|
+
? `Will reuse previously cached WDA instance at '${cachedUrl}' with '${productBundleIdentifier}'`
|
|
390
|
+
: `Will reuse previously cached WDA instance at '${cachedUrl}'`;
|
|
389
391
|
this.log.info(`${message}. Set the wdaLocalPort capability to a value different from ${this.url.port} if this is an undesired behavior.`);
|
|
390
|
-
this.webDriverAgentUrl =
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Quit and uninstall running WDA.
|
|
394
|
-
*/
|
|
395
|
-
async quitAndUninstall() {
|
|
396
|
-
await this.quit();
|
|
397
|
-
await this.uninstall();
|
|
398
|
-
}
|
|
399
|
-
async parseBundleId(wdaBundlePath) {
|
|
400
|
-
const infoPlistPath = node_path_1.default.join(wdaBundlePath, 'Info.plist');
|
|
401
|
-
const infoPlist = (await support_1.plist.parsePlist(await support_1.fs.readFile(infoPlistPath)));
|
|
402
|
-
if (!infoPlist.CFBundleIdentifier) {
|
|
403
|
-
throw new Error(`Could not find bundle id in '${infoPlistPath}'`);
|
|
404
|
-
}
|
|
405
|
-
return infoPlist.CFBundleIdentifier;
|
|
406
|
-
}
|
|
407
|
-
async fetchWDABundle() {
|
|
408
|
-
if (!this.derivedDataPath) {
|
|
409
|
-
return await (0, check_dependencies_1.bundleWDASim)(this.xcodebuild);
|
|
410
|
-
}
|
|
411
|
-
const wdaBundlePaths = await support_1.fs.glob(`${this.derivedDataPath}/**/*${constants_1.WDA_RUNNER_APP}/`, {
|
|
412
|
-
absolute: true,
|
|
413
|
-
});
|
|
414
|
-
if (wdaBundlePaths.length === 0) {
|
|
415
|
-
throw new Error(`Could not find the WDA bundle in '${this.derivedDataPath}'`);
|
|
416
|
-
}
|
|
417
|
-
return wdaBundlePaths[0];
|
|
392
|
+
this.webDriverAgentUrl = cachedUrl;
|
|
393
|
+
return cachedUrl;
|
|
418
394
|
}
|
|
419
395
|
setupProxies(sessionId) {
|
|
420
396
|
const proxyOpts = {
|
|
@@ -456,9 +432,6 @@ class WebDriverAgent {
|
|
|
456
432
|
this.agentPath = agentPath || node_path_1.default.resolve(this.bootstrapPath, 'WebDriverAgent.xcodeproj');
|
|
457
433
|
this.log.info(`Using WDA agent: '${this.agentPath}'`);
|
|
458
434
|
}
|
|
459
|
-
async isRunning() {
|
|
460
|
-
return !!(await this.getStatus());
|
|
461
|
-
}
|
|
462
435
|
/**
|
|
463
436
|
* Return current running WDA's status like below
|
|
464
437
|
* {
|
|
@@ -523,29 +496,6 @@ class WebDriverAgent {
|
|
|
523
496
|
}
|
|
524
497
|
return status;
|
|
525
498
|
}
|
|
526
|
-
/**
|
|
527
|
-
* Uninstall WDAs from the test device.
|
|
528
|
-
* Over Xcode 11, multiple WDA can be in the device since Xcode 11 generates different WDA.
|
|
529
|
-
* Appium does not expect multiple WDAs are running on a device.
|
|
530
|
-
*/
|
|
531
|
-
async uninstall() {
|
|
532
|
-
try {
|
|
533
|
-
const bundleIds = await this.device.getUserInstalledBundleIdsByBundleName(WDA_CF_BUNDLE_NAME);
|
|
534
|
-
if (bundleIds.length === 0) {
|
|
535
|
-
this.log.debug('No WDAs on the device.');
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
this.log.debug(`Uninstalling WDAs: '${bundleIds}'`);
|
|
539
|
-
for (const bundleId of bundleIds) {
|
|
540
|
-
await this.device.removeApp(bundleId);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
catch (e) {
|
|
544
|
-
this.log.debug(e);
|
|
545
|
-
this.log.warn(`WebDriverAgent uninstall failed. Perhaps, it is already uninstalled? ` +
|
|
546
|
-
`Original error: ${e.message}`);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
499
|
async _cleanupProjectIfFresh() {
|
|
550
500
|
if (this.canSkipXcodebuild) {
|
|
551
501
|
return;
|
|
@@ -609,14 +559,14 @@ class WebDriverAgent {
|
|
|
609
559
|
* https://github.com/appium/WebDriverAgent/releases
|
|
610
560
|
* with proper sign for this case.
|
|
611
561
|
*
|
|
612
|
-
* When we implement launching XCTest service via appium-ios-device,
|
|
613
|
-
* this implementation can be replaced with it.
|
|
614
|
-
*
|
|
615
562
|
* @param opts launching WDA with devicectl command options.
|
|
616
563
|
*/
|
|
617
564
|
async _launchViaDevicectl(opts = {}) {
|
|
618
565
|
const { env } = opts;
|
|
619
|
-
await this.device.devicectl.launchApp(this.bundleIdForXctest, {
|
|
566
|
+
await this.device.devicectl.launchApp(this.bundleIdForXctest, {
|
|
567
|
+
env,
|
|
568
|
+
terminateExisting: true,
|
|
569
|
+
});
|
|
620
570
|
}
|
|
621
571
|
/**
|
|
622
572
|
* Launch WDA with preinstalled package without xcodebuild.
|
|
@@ -635,18 +585,7 @@ class WebDriverAgent {
|
|
|
635
585
|
}
|
|
636
586
|
this.log.info('Launching WebDriverAgent on the device without xcodebuild');
|
|
637
587
|
if (this.isRealDevice) {
|
|
638
|
-
|
|
639
|
-
// but it has limitation about the WDA preinstalled package.
|
|
640
|
-
// https://github.com/appium/appium/issues/19206#issuecomment-2014182674
|
|
641
|
-
if (this.platformVersion && support_1.util.compareVersions(this.platformVersion, '>=', '17.0')) {
|
|
642
|
-
await this._launchViaDevicectl({ env: xctestEnv });
|
|
643
|
-
}
|
|
644
|
-
else {
|
|
645
|
-
this.xctestApiClient = new appium_ios_device_1.Xctest(this.device.udid, this.bundleIdForXctest, null, {
|
|
646
|
-
env: xctestEnv,
|
|
647
|
-
});
|
|
648
|
-
await this.xctestApiClient.start();
|
|
649
|
-
}
|
|
588
|
+
await this._launchViaDevicectl({ env: xctestEnv });
|
|
650
589
|
}
|
|
651
590
|
else {
|
|
652
591
|
await this.device.simctl.exec('launch', {
|