appium-xcuitest-driver 7.6.1 → 7.7.1
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 +14 -0
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +9 -17
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +2 -4
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +3 -6
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts +1 -1
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +3 -5
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/condition.d.ts.map +1 -1
- package/build/lib/commands/condition.js +2 -4
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +1 -2
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/deviceInfo.d.ts.map +1 -1
- package/build/lib/commands/deviceInfo.js +1 -2
- package/build/lib/commands/deviceInfo.js.map +1 -1
- package/build/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +14 -22
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +1 -2
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +1 -2
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/keychains.js +1 -2
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.d.ts.map +1 -1
- package/build/lib/commands/localization.js +1 -3
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +1 -2
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +2 -4
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +2 -2
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +1 -1
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +1 -2
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +2 -4
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +1 -2
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +4 -9
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +2 -4
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +1 -2
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +3 -2
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +8 -3
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +1 -2
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +2 -4
- package/build/lib/commands/xctest-record-screen.js.map +1 -1
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +2 -4
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/driver.d.ts +26 -8
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +89 -83
- package/build/lib/driver.js.map +1 -1
- package/build/lib/py-ios-device-client.d.ts +1 -1
- package/build/lib/real-device-management.d.ts +30 -27
- package/build/lib/real-device-management.d.ts.map +1 -1
- package/build/lib/real-device-management.js +34 -35
- package/build/lib/real-device-management.js.map +1 -1
- package/build/lib/real-device.d.ts +36 -9
- package/build/lib/real-device.d.ts.map +1 -1
- package/build/lib/real-device.js +46 -15
- package/build/lib/real-device.js.map +1 -1
- package/build/lib/simulator-management.d.ts +58 -68
- package/build/lib/simulator-management.d.ts.map +1 -1
- package/build/lib/simulator-management.js +74 -66
- package/build/lib/simulator-management.js.map +1 -1
- package/lib/commands/app-management.js +11 -18
- package/lib/commands/appearance.js +4 -4
- package/lib/commands/biometric.js +3 -6
- package/lib/commands/certificate.js +3 -5
- package/lib/commands/condition.js +2 -4
- package/lib/commands/context.js +1 -2
- package/lib/commands/deviceInfo.js +1 -2
- package/lib/commands/file-movement.js +14 -22
- package/lib/commands/general.js +1 -2
- package/lib/commands/gesture.js +1 -2
- package/lib/commands/keychains.js +2 -2
- package/lib/commands/localization.js +1 -4
- package/lib/commands/location.js +1 -2
- package/lib/commands/log.js +2 -4
- package/lib/commands/memory.js +2 -2
- package/lib/commands/notifications.js +1 -2
- package/lib/commands/pasteboard.js +4 -4
- package/lib/commands/pcap.js +1 -2
- package/lib/commands/performance.js +4 -8
- package/lib/commands/permissions.js +6 -4
- package/lib/commands/recordscreen.js +1 -2
- package/lib/commands/screenshots.js +8 -3
- package/lib/commands/web.js +1 -2
- package/lib/commands/xctest-record-screen.js +2 -4
- package/lib/commands/xctest.js +2 -4
- package/lib/driver.js +91 -86
- package/lib/real-device-management.js +37 -44
- package/lib/real-device.js +47 -17
- package/lib/simulator-management.js +83 -82
- package/npm-shrinkwrap.json +14 -36
- package/package.json +2 -2
package/build/lib/driver.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type XCUITestDriverOpts = import('@appium/types').DriverOpts<XCUITestDriv
|
|
|
5
5
|
export type FullContext = import('./commands/types').FullContext;
|
|
6
6
|
export type WDACapabilities = import('./types').WDACapabilities;
|
|
7
7
|
export type XcodeVersion = import('appium-xcode').XcodeVersion;
|
|
8
|
+
export type Simulator = import('appium-ios-simulator').Simulator;
|
|
9
|
+
export type RealDevice = import('./real-device').RealDevice;
|
|
8
10
|
/**
|
|
9
11
|
* @implements {ExternalDriver<XCUITestDriverConstraints, FullContext|string>}
|
|
10
12
|
* @extends {BaseDriver<XCUITestDriverConstraints>}
|
|
@@ -1503,6 +1505,10 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1503
1505
|
};
|
|
1504
1506
|
}>;
|
|
1505
1507
|
mergeCliArgsToOpts(): boolean;
|
|
1508
|
+
/**
|
|
1509
|
+
* @returns {Simulator|RealDevice}
|
|
1510
|
+
*/
|
|
1511
|
+
get device(): import("./real-device").RealDevice | import("appium-ios-simulator").Simulator;
|
|
1506
1512
|
isXcodebuildNeeded(): boolean;
|
|
1507
1513
|
createSession(w3cCaps1: any, w3cCaps2: any, w3cCaps3: any, driverData: any): Promise<[string, import("@appium/types").DriverCaps<{
|
|
1508
1514
|
readonly platformName: {
|
|
@@ -1876,9 +1882,9 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1876
1882
|
startWda(sessionId: string): Promise<void>;
|
|
1877
1883
|
/**
|
|
1878
1884
|
*
|
|
1879
|
-
* @param {
|
|
1885
|
+
* @param {boolean} [enforceSimulatorShutdown=false]
|
|
1880
1886
|
*/
|
|
1881
|
-
runReset(
|
|
1887
|
+
runReset(enforceSimulatorShutdown?: boolean | undefined): Promise<void>;
|
|
1882
1888
|
deleteSession(): Promise<void>;
|
|
1883
1889
|
stop(): Promise<void>;
|
|
1884
1890
|
/**
|
|
@@ -1971,9 +1977,21 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1971
1977
|
skipUninstall: boolean;
|
|
1972
1978
|
}>;
|
|
1973
1979
|
installAUT(): Promise<void>;
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1980
|
+
/**
|
|
1981
|
+
* @param {string|string[]} otherApps
|
|
1982
|
+
* @returns {Promise<void>}
|
|
1983
|
+
*/
|
|
1984
|
+
installOtherApps(otherApps: string | string[]): Promise<void>;
|
|
1985
|
+
/**
|
|
1986
|
+
* @param {string} orientation
|
|
1987
|
+
* @returns {Promise<void>}
|
|
1988
|
+
*/
|
|
1989
|
+
setInitialOrientation(orientation: string): Promise<void>;
|
|
1990
|
+
/**
|
|
1991
|
+
* @param {string} [cmdName]
|
|
1992
|
+
* @returns {number|undefined}
|
|
1993
|
+
*/
|
|
1994
|
+
_getCommandTimeout(cmdName?: string | undefined): number | undefined;
|
|
1977
1995
|
preparePreinstalledWda(): Promise<void>;
|
|
1978
1996
|
mobileGetActiveAppInfo: (this: XCUITestDriver) => Promise<import("./commands/types").ActiveAppInfo>;
|
|
1979
1997
|
getAlertText: (this: XCUITestDriver) => Promise<string | null>;
|
|
@@ -3507,7 +3525,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
3507
3525
|
closeWindow: (this: XCUITestDriver) => Promise<any>;
|
|
3508
3526
|
nativeBack: (this: XCUITestDriver) => Promise<unknown>;
|
|
3509
3527
|
mobileDeepLink: (this: XCUITestDriver, url: string, bundleId?: string | undefined) => Promise<void>;
|
|
3510
|
-
mobilePushNotification: (this: XCUITestDriver, bundleId: string, payload: import("./commands/types").PushPayload) => Promise<
|
|
3528
|
+
mobilePushNotification: (this: XCUITestDriver, bundleId: string, payload: import("./commands/types").PushPayload) => Promise<void>;
|
|
3511
3529
|
mobileExpectNotification: (this: XCUITestDriver, name: string, type?: import("./commands/types").NotificationType, timeoutSeconds?: number) => Promise<unknown>;
|
|
3512
3530
|
mobileSetPasteboard: (this: XCUITestDriver, content: string, encoding?: string) => Promise<void>;
|
|
3513
3531
|
mobileGetPasteboard: (this: XCUITestDriver, encoding?: string) => Promise<string>;
|
|
@@ -3524,9 +3542,9 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
3524
3542
|
_recentScreenRecorder: import("./commands/recordscreen").ScreenRecorder | null;
|
|
3525
3543
|
startRecordingScreen: (this: XCUITestDriver, options?: import("./commands/types").StartRecordingScreenOptions | undefined) => Promise<string>;
|
|
3526
3544
|
stopRecordingScreen: (this: XCUITestDriver, options?: import("./commands/types").StopRecordingScreenOptions) => Promise<string | null>;
|
|
3527
|
-
getScreenshot: (this: XCUITestDriver) => Promise<
|
|
3545
|
+
getScreenshot: (this: XCUITestDriver) => Promise<string>;
|
|
3528
3546
|
getElementScreenshot: (this: XCUITestDriver, el: any) => Promise<any>;
|
|
3529
|
-
getViewportScreenshot: (this: XCUITestDriver) => Promise<
|
|
3547
|
+
getViewportScreenshot: (this: XCUITestDriver) => Promise<string>;
|
|
3530
3548
|
getPageSource: (this: XCUITestDriver) => Promise<any>;
|
|
3531
3549
|
mobileGetSource: (this: XCUITestDriver, format?: import("./commands/types").SourceFormat, excludedAttributes?: string | undefined) => Promise<string>;
|
|
3532
3550
|
pageLoadTimeoutW3C: (this: XCUITestDriver, ms: any) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";0FAstEa,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC;wCAI9C,4BAA4B;iCAC5B,OAAO,eAAe,EAAE,UAAU,CAAC,yBAAyB,CAAC;0BAC7D,OAAO,kBAAkB,EAAE,WAAW;8BACtC,OAAO,SAAS,EAAE,eAAe;2BACjC,OAAO,cAAc,EAAE,YAAY;wBACnC,OAAO,sBAAsB,EAAE,SAAS;yBACxC,OAAO,eAAe,EAAE,UAAU;AA/iE/C;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAwG;CACzG;sCA3qEmC,gBAAgB;2BAvBH,eAAe;yBAMzC,WAAW;+BANe,eAAe;sBAC1B,gBAAgB"}
|
package/build/lib/driver.js
CHANGED
|
@@ -610,6 +610,13 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
610
610
|
}
|
|
611
611
|
return didMerge;
|
|
612
612
|
}
|
|
613
|
+
/**
|
|
614
|
+
* @returns {Simulator|RealDevice}
|
|
615
|
+
*/
|
|
616
|
+
get device() {
|
|
617
|
+
// @ts-ignore This property should exist
|
|
618
|
+
return this.opts?.device;
|
|
619
|
+
}
|
|
613
620
|
isXcodebuildNeeded() {
|
|
614
621
|
return !(CAP_NAMES_NO_XCODEBUILD_REQUIRED.some((x) => Boolean(this.opts[x])));
|
|
615
622
|
}
|
|
@@ -700,6 +707,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
700
707
|
this.opts.iosSdkVersion = null; // For WDA and xcodebuild
|
|
701
708
|
const { device, udid, realDevice } = await this.determineDevice();
|
|
702
709
|
this.log.info(`Determining device to run tests on: udid: '${udid}', real device: ${realDevice}`);
|
|
710
|
+
// TODO: extract device out of opts to a separate driver property
|
|
703
711
|
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
704
712
|
this.opts.device = device;
|
|
705
713
|
this.opts.udid = udid;
|
|
@@ -711,18 +719,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
711
719
|
}
|
|
712
720
|
else {
|
|
713
721
|
this.log.info(`Setting simulator devices set path to '${this.opts.simulatorDevicesSetPath}'`);
|
|
714
|
-
|
|
715
|
-
this.opts.device.devicesSetPath = this.opts.simulatorDevicesSetPath;
|
|
722
|
+
( /** @type {Simulator} */(this.device)).devicesSetPath = this.opts.simulatorDevicesSetPath;
|
|
716
723
|
}
|
|
717
724
|
}
|
|
718
725
|
// at this point if there is no platformVersion, get it from the device
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
722
|
-
this.opts.platformVersion = await this.opts.device.getPlatformVersion();
|
|
726
|
+
if (!this.opts.platformVersion) {
|
|
727
|
+
this.opts.platformVersion = await this.device.getPlatformVersion();
|
|
723
728
|
this.log.info(`No platformVersion specified. Using device version: '${this.opts.platformVersion}'`);
|
|
724
729
|
}
|
|
725
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
726
730
|
const normalizedVersion = (0, utils_1.normalizePlatformVersion)(this.opts.platformVersion);
|
|
727
731
|
if (this.opts.platformVersion !== normalizedVersion) {
|
|
728
732
|
this.log.info(`Normalized platformVersion capability value '${this.opts.platformVersion}' to '${normalizedVersion}'`);
|
|
@@ -794,16 +798,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
794
798
|
if (!this.opts.app &&
|
|
795
799
|
this.opts.bundleId &&
|
|
796
800
|
!this.isSafari() &&
|
|
797
|
-
|
|
798
|
-
!(await this.opts.device.isAppInstalled(this.opts.bundleId))) {
|
|
801
|
+
!(await this.device.isAppInstalled(this.opts.bundleId))) {
|
|
799
802
|
this.log.errorAndThrow(`App with bundle identifier '${this.opts.bundleId}' unknown`);
|
|
800
803
|
}
|
|
801
804
|
if (this.isSimulator()) {
|
|
802
805
|
if (this.opts.permissions) {
|
|
803
806
|
this.log.debug('Setting the requested permissions before WDA is started');
|
|
804
807
|
for (const [bundleId, permissionsMapping] of lodash_1.default.toPairs(JSON.parse(this.opts.permissions))) {
|
|
805
|
-
|
|
806
|
-
await this.opts.device.setPermissions(bundleId, permissionsMapping);
|
|
808
|
+
await /** @type {Simulator} */ (this.device).setPermissions(bundleId, permissionsMapping);
|
|
807
809
|
}
|
|
808
810
|
}
|
|
809
811
|
// TODO: Deprecate and remove this block together with calendarAccessAuthorized capability
|
|
@@ -811,13 +813,12 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
811
813
|
this.log.warn(`The 'calendarAccessAuthorized' capability is deprecated and will be removed soon. ` +
|
|
812
814
|
`Consider using 'permissions' one instead with 'calendar' key`);
|
|
813
815
|
const methodName = `${this.opts.calendarAccessAuthorized ? 'enable' : 'disable'}CalendarAccess`;
|
|
814
|
-
|
|
815
|
-
await this.opts.device[methodName](this.opts.bundleId);
|
|
816
|
+
await this.device[methodName](this.opts.bundleId);
|
|
816
817
|
}
|
|
817
818
|
}
|
|
818
819
|
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
819
820
|
await this.startWda(this.opts.sessionId);
|
|
820
|
-
if (this.opts.orientation) {
|
|
821
|
+
if (lodash_1.default.isString(this.opts.orientation)) {
|
|
821
822
|
await this.setInitialOrientation(this.opts.orientation);
|
|
822
823
|
this.logEvent('orientationSet');
|
|
823
824
|
}
|
|
@@ -841,11 +842,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
841
842
|
* Start the simulator and initialize based on capabilities
|
|
842
843
|
*/
|
|
843
844
|
async initSimulator() {
|
|
844
|
-
|
|
845
|
-
const device = this.opts.device;
|
|
845
|
+
const device = /** @type {Simulator} */ (this.device);
|
|
846
846
|
if (this.opts.shutdownOtherSimulators) {
|
|
847
847
|
this.assertFeatureEnabled(SHUTDOWN_OTHER_FEAT_NAME);
|
|
848
|
-
await
|
|
848
|
+
await simulator_management_1.shutdownOtherSimulators.bind(this)();
|
|
849
849
|
}
|
|
850
850
|
await this.startSim();
|
|
851
851
|
if (this.opts.customSSLCert) {
|
|
@@ -853,15 +853,19 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
853
853
|
await device.addCertificate(this.opts.customSSLCert);
|
|
854
854
|
this.logEvent('customCertInstalled');
|
|
855
855
|
}
|
|
856
|
-
if (await
|
|
856
|
+
if (await simulator_management_1.setSafariPrefs.bind(this)()) {
|
|
857
857
|
this.log.debug('Safari preferences have been updated');
|
|
858
858
|
}
|
|
859
|
-
if (await
|
|
859
|
+
if (await simulator_management_1.setLocalizationPrefs.bind(this)()) {
|
|
860
860
|
this.log.debug('Localization preferences have been updated');
|
|
861
861
|
}
|
|
862
|
+
/** @type {Promise[]} */
|
|
862
863
|
const promises = ['reduceMotion', 'reduceTransparency', 'autoFillPasswords']
|
|
863
864
|
.filter((optName) => lodash_1.default.isBoolean(this.opts[optName]))
|
|
864
|
-
.map((optName) =>
|
|
865
|
+
.map((optName) => {
|
|
866
|
+
this.log.info(`Setting ${optName} to ${this.opts[optName]}`);
|
|
867
|
+
return device[`set${lodash_1.default.upperFirst(optName)}`](this.opts[optName]);
|
|
868
|
+
});
|
|
865
869
|
await bluebird_1.default.all(promises);
|
|
866
870
|
if (this.opts.launchWithIDB) {
|
|
867
871
|
try {
|
|
@@ -973,14 +977,22 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
973
977
|
errorMsg += `. Make sure you follow the tutorial at ${WDA_REAL_DEV_TUTORIAL_URL}`;
|
|
974
978
|
}
|
|
975
979
|
if (this.opts.usePreinstalledWDA) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
980
|
+
try {
|
|
981
|
+
// In case the bundle id process start got failed because of
|
|
982
|
+
// auth popup in the device. Then, the bundle id process itself started. It is safe to stop it here.
|
|
983
|
+
await this.mobileKillApp(this.wda.bundleIdForXctest);
|
|
984
|
+
}
|
|
985
|
+
catch (ign) { }
|
|
986
|
+
;
|
|
979
987
|
// Mostly it failed to start the WDA process as no the bundle id
|
|
980
988
|
// e.g. '<bundle id of WDA> not found on device <udid>'
|
|
981
|
-
|
|
982
|
-
`Make sure the application ${this.wda.bundleIdForXctest} exists and it is launchable
|
|
983
|
-
|
|
989
|
+
errorMsg = `Unable to launch WebDriverAgent. Original error: ${err.message}. ` +
|
|
990
|
+
`Make sure the application ${this.wda.bundleIdForXctest} exists and it is launchable.`;
|
|
991
|
+
if (this.isRealDevice()) {
|
|
992
|
+
errorMsg += ` ${WDA_REAL_DEV_TUTORIAL_URL} may help to complete the preparation.`;
|
|
993
|
+
}
|
|
994
|
+
;
|
|
995
|
+
throw new Error(errorMsg);
|
|
984
996
|
}
|
|
985
997
|
else {
|
|
986
998
|
await quitAndUninstall(errorMsg);
|
|
@@ -1024,17 +1036,15 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1024
1036
|
}
|
|
1025
1037
|
/**
|
|
1026
1038
|
*
|
|
1027
|
-
* @param {
|
|
1039
|
+
* @param {boolean} [enforceSimulatorShutdown=false]
|
|
1028
1040
|
*/
|
|
1029
|
-
async runReset(
|
|
1041
|
+
async runReset(enforceSimulatorShutdown = false) {
|
|
1030
1042
|
this.logEvent('resetStarted');
|
|
1031
1043
|
if (this.isRealDevice()) {
|
|
1032
|
-
|
|
1033
|
-
await (0, real_device_management_1.runRealDeviceReset)(this.opts.device, opts || this.opts);
|
|
1044
|
+
await real_device_management_1.runRealDeviceReset.bind(this)();
|
|
1034
1045
|
}
|
|
1035
1046
|
else {
|
|
1036
|
-
|
|
1037
|
-
await (0, simulator_management_1.runSimulatorReset)(this.opts.device, opts || this.opts);
|
|
1047
|
+
await simulator_management_1.runSimulatorReset.bind(this)(enforceSimulatorShutdown);
|
|
1038
1048
|
}
|
|
1039
1049
|
this.logEvent('resetComplete');
|
|
1040
1050
|
}
|
|
@@ -1076,15 +1086,12 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1076
1086
|
await this.stopRemote();
|
|
1077
1087
|
}
|
|
1078
1088
|
if (this.opts.resetOnSessionStartOnly === false) {
|
|
1079
|
-
await this.runReset(
|
|
1080
|
-
enforceSimulatorShutdown: true,
|
|
1081
|
-
}));
|
|
1089
|
+
await this.runReset(true);
|
|
1082
1090
|
}
|
|
1083
|
-
|
|
1084
|
-
const simulatorDevice = this.isSimulator() ? this.opts.device : null;
|
|
1091
|
+
const simulatorDevice = this.isSimulator() ? /** @type {Simulator} */ (this.device) : null;
|
|
1085
1092
|
if (simulatorDevice && this.lifecycleData.createSim) {
|
|
1086
1093
|
this.log.debug(`Deleting simulator created for this run (udid: '${simulatorDevice.udid}')`);
|
|
1087
|
-
await
|
|
1094
|
+
await simulator_management_1.shutdownSimulator.bind(this)();
|
|
1088
1095
|
await simulatorDevice.delete();
|
|
1089
1096
|
}
|
|
1090
1097
|
const shouldResetLocationServivce = this.isRealDevice() && !!this.opts.resetLocationService;
|
|
@@ -1267,18 +1274,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1267
1274
|
// if we get generic names, translate them
|
|
1268
1275
|
this.opts.deviceName = (0, utils_1.translateDeviceName)(this.opts.platformVersion, this.opts.deviceName);
|
|
1269
1276
|
const setupVersionCaps = async () => {
|
|
1277
|
+
const iosSdkVersion = await (0, utils_1.getAndCheckIosSdkVersion)();
|
|
1270
1278
|
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1271
|
-
this.opts.iosSdkVersion =
|
|
1272
|
-
|
|
1273
|
-
this.
|
|
1274
|
-
|
|
1275
|
-
if (!this.opts.platformVersion && this.opts.iosSdkVersion) {
|
|
1276
|
-
this.log.info(
|
|
1277
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1278
|
-
`No platformVersion specified. Using the latest version Xcode supports: '${this.opts.iosSdkVersion}'. ` +
|
|
1279
|
+
this.opts.iosSdkVersion = iosSdkVersion;
|
|
1280
|
+
this.log.info(`iOS SDK Version set to '${iosSdkVersion}'`);
|
|
1281
|
+
if (!this.opts.platformVersion && iosSdkVersion) {
|
|
1282
|
+
this.log.info(`No platformVersion specified. Using the latest version Xcode supports: '${iosSdkVersion}'. ` +
|
|
1279
1283
|
`This may cause problems if a simulator does not exist for this platform version.`);
|
|
1280
|
-
|
|
1281
|
-
this.opts.platformVersion = (0, utils_1.normalizePlatformVersion)(this.opts.iosSdkVersion);
|
|
1284
|
+
this.opts.platformVersion = (0, utils_1.normalizePlatformVersion)(iosSdkVersion);
|
|
1282
1285
|
}
|
|
1283
1286
|
};
|
|
1284
1287
|
if (this.opts.udid) {
|
|
@@ -1290,11 +1293,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1290
1293
|
// Trying to find matching UDID for Simulator
|
|
1291
1294
|
this.log.warn(`Cannot detect any connected real devices. Falling back to Simulator. Original error: ${err.message}`);
|
|
1292
1295
|
await setupVersionCaps();
|
|
1293
|
-
|
|
1294
|
-
const device = await (0, simulator_management_1.getExistingSim)(this.opts);
|
|
1296
|
+
const device = await simulator_management_1.getExistingSim.bind(this)();
|
|
1295
1297
|
if (!device) {
|
|
1296
1298
|
// No matching Simulator is found. Throw an error
|
|
1297
|
-
this.log.
|
|
1299
|
+
throw this.log.errorWithException(`Cannot detect udid for ${this.opts.deviceName} Simulator running iOS ${this.opts.platformVersion}`);
|
|
1298
1300
|
}
|
|
1299
1301
|
this.opts.udid = device.udid;
|
|
1300
1302
|
return { device, realDevice: false, udid: device.udid };
|
|
@@ -1316,6 +1318,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1316
1318
|
try {
|
|
1317
1319
|
const device = await (0, appium_ios_simulator_1.getSimulator)(this.opts.udid, {
|
|
1318
1320
|
devicesSetPath: this.opts.simulatorDevicesSetPath,
|
|
1321
|
+
logger: this.log,
|
|
1319
1322
|
});
|
|
1320
1323
|
return { device, realDevice: false, udid: this.opts.udid };
|
|
1321
1324
|
}
|
|
@@ -1325,7 +1328,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1325
1328
|
}
|
|
1326
1329
|
}
|
|
1327
1330
|
}
|
|
1328
|
-
const device =
|
|
1331
|
+
const device = real_device_management_1.getRealDeviceObj.bind(this)();
|
|
1329
1332
|
return { device, realDevice: true, udid: this.opts.udid };
|
|
1330
1333
|
}
|
|
1331
1334
|
this.log.info(`No real device udid has been provided in capabilities. ` +
|
|
@@ -1336,8 +1339,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1336
1339
|
}
|
|
1337
1340
|
else {
|
|
1338
1341
|
// figure out the correct simulator to use, given the desired capabilities
|
|
1339
|
-
|
|
1340
|
-
const device = await (0, simulator_management_1.getExistingSim)(this.opts);
|
|
1342
|
+
const device = await simulator_management_1.getExistingSim.bind(this)();
|
|
1341
1343
|
// check for an existing simulator
|
|
1342
1344
|
if (device) {
|
|
1343
1345
|
return { device, realDevice: false, udid: device.udid };
|
|
@@ -1349,19 +1351,20 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1349
1351
|
return { device, realDevice: false, udid: device.udid };
|
|
1350
1352
|
}
|
|
1351
1353
|
async startSim() {
|
|
1354
|
+
/** @type {import('appium-ios-simulator').DevicePreferences} */
|
|
1355
|
+
const devicePreferences = {};
|
|
1356
|
+
/** @type {import('appium-ios-simulator').RunOptions} */
|
|
1352
1357
|
const runOpts = {
|
|
1353
1358
|
scaleFactor: this.opts.scaleFactor,
|
|
1354
1359
|
connectHardwareKeyboard: !!this.opts.connectHardwareKeyboard,
|
|
1355
1360
|
pasteboardAutomaticSync: this.opts.simulatorPasteboardAutomaticSync ?? 'off',
|
|
1356
1361
|
isHeadless: !!this.opts.isHeadless,
|
|
1357
1362
|
tracePointer: this.opts.simulatorTracePointer,
|
|
1358
|
-
devicePreferences
|
|
1363
|
+
devicePreferences,
|
|
1359
1364
|
};
|
|
1360
1365
|
// add the window center, if it is specified
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1364
|
-
runOpts.devicePreferences.SimulatorWindowCenter = this.opts.SimulatorWindowCenter;
|
|
1366
|
+
if (this.opts.simulatorWindowCenter) {
|
|
1367
|
+
devicePreferences.SimulatorWindowCenter = this.opts.simulatorWindowCenter;
|
|
1365
1368
|
}
|
|
1366
1369
|
if (lodash_1.default.isInteger(this.opts.simulatorStartupTimeout)) {
|
|
1367
1370
|
runOpts.startupTimeout = this.opts.simulatorStartupTimeout;
|
|
@@ -1371,21 +1374,20 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1371
1374
|
const orientation = lodash_1.default.isString(this.opts.orientation) && this.opts.orientation.toUpperCase();
|
|
1372
1375
|
switch (orientation) {
|
|
1373
1376
|
case 'LANDSCAPE':
|
|
1374
|
-
|
|
1375
|
-
|
|
1377
|
+
devicePreferences.SimulatorWindowOrientation = 'LandscapeLeft';
|
|
1378
|
+
devicePreferences.SimulatorWindowRotationAngle = 90;
|
|
1376
1379
|
break;
|
|
1377
1380
|
case 'PORTRAIT':
|
|
1378
|
-
|
|
1379
|
-
|
|
1381
|
+
devicePreferences.SimulatorWindowOrientation = 'Portrait';
|
|
1382
|
+
devicePreferences.SimulatorWindowRotationAngle = 0;
|
|
1380
1383
|
break;
|
|
1381
1384
|
}
|
|
1382
|
-
|
|
1383
|
-
await this.opts.device.run(runOpts);
|
|
1385
|
+
await /** @type {Simulator} */ (this.device).run(runOpts);
|
|
1384
1386
|
}
|
|
1385
1387
|
async createSim() {
|
|
1386
1388
|
this.lifecycleData.createSim = true;
|
|
1387
1389
|
// create sim for caps
|
|
1388
|
-
const sim = await
|
|
1390
|
+
const sim = await simulator_management_1.createSim.bind(this)();
|
|
1389
1391
|
this.log.info(`Created simulator with udid '${sim.udid}'.`);
|
|
1390
1392
|
return sim;
|
|
1391
1393
|
}
|
|
@@ -1695,16 +1697,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1695
1697
|
const { install, skipUninstall } = await this.checkAutInstallationState();
|
|
1696
1698
|
if (install) {
|
|
1697
1699
|
if (this.isRealDevice()) {
|
|
1698
|
-
|
|
1699
|
-
await (0, real_device_management_1.installToRealDevice)(this.opts.device, this.opts.app, this.opts.bundleId, {
|
|
1700
|
+
await real_device_management_1.installToRealDevice.bind(this)(this.opts.app, this.opts.bundleId, {
|
|
1700
1701
|
skipUninstall,
|
|
1701
1702
|
timeout: this.opts.appPushTimeout,
|
|
1702
1703
|
strategy: this.opts.appInstallStrategy,
|
|
1703
1704
|
});
|
|
1704
1705
|
}
|
|
1705
1706
|
else {
|
|
1706
|
-
|
|
1707
|
-
await (0, simulator_management_1.installToSimulator)(this.opts.device, this.opts.app, this.opts.bundleId, {
|
|
1707
|
+
await simulator_management_1.installToSimulator.bind(this)(this.opts.app, this.opts.bundleId, {
|
|
1708
1708
|
skipUninstall,
|
|
1709
1709
|
newSimulator: this.lifecycleData?.createSim,
|
|
1710
1710
|
});
|
|
@@ -1718,6 +1718,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1718
1718
|
this.logEvent('appInstalled');
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
+
/**
|
|
1722
|
+
* @param {string|string[]} otherApps
|
|
1723
|
+
* @returns {Promise<void>}
|
|
1724
|
+
*/
|
|
1721
1725
|
async installOtherApps(otherApps) {
|
|
1722
1726
|
/** @type {string[]|undefined} */
|
|
1723
1727
|
let appsList;
|
|
@@ -1737,25 +1741,23 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1737
1741
|
const appIds = await bluebird_1.default.all(appPaths.map((appPath) => (0, app_utils_1.extractBundleId)(appPath)));
|
|
1738
1742
|
for (const [appId, appPath] of lodash_1.default.zip(appIds, appPaths)) {
|
|
1739
1743
|
if (this.isRealDevice()) {
|
|
1740
|
-
await
|
|
1741
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1742
|
-
this.opts.device, appPath, appId, {
|
|
1744
|
+
await real_device_management_1.installToRealDevice.bind(this)(appPath, appId, {
|
|
1743
1745
|
skipUninstall: true, // to make the behavior as same as UIA2
|
|
1744
1746
|
timeout: this.opts.appPushTimeout,
|
|
1745
1747
|
strategy: this.opts.appInstallStrategy,
|
|
1746
1748
|
});
|
|
1747
1749
|
}
|
|
1748
1750
|
else {
|
|
1749
|
-
await
|
|
1750
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1751
|
-
this.opts.device,
|
|
1752
|
-
// @ts-ignore the path should always be defined
|
|
1753
|
-
appPath, appId, {
|
|
1751
|
+
await simulator_management_1.installToSimulator.bind(this)(appPath, appId, {
|
|
1754
1752
|
newSimulator: this.lifecycleData.createSim,
|
|
1755
1753
|
});
|
|
1756
1754
|
}
|
|
1757
1755
|
}
|
|
1758
1756
|
}
|
|
1757
|
+
/**
|
|
1758
|
+
* @param {string} orientation
|
|
1759
|
+
* @returns {Promise<void>}
|
|
1760
|
+
*/
|
|
1759
1761
|
async setInitialOrientation(orientation) {
|
|
1760
1762
|
const dstOrientation = lodash_1.default.toUpper(orientation);
|
|
1761
1763
|
if (!SUPPORTED_ORIENATIONS.includes(dstOrientation)) {
|
|
@@ -1771,6 +1773,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1771
1773
|
this.log.warn(`Setting initial orientation failed with: ${err.message}`);
|
|
1772
1774
|
}
|
|
1773
1775
|
}
|
|
1776
|
+
/**
|
|
1777
|
+
* @param {string} [cmdName]
|
|
1778
|
+
* @returns {number|undefined}
|
|
1779
|
+
*/
|
|
1774
1780
|
_getCommandTimeout(cmdName) {
|
|
1775
1781
|
if (this.opts.commandTimeouts) {
|
|
1776
1782
|
if (cmdName && lodash_1.default.has(this.opts.commandTimeouts, cmdName)) {
|
|
@@ -1799,19 +1805,17 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1799
1805
|
this.wda.updatedWDABundleId = candidateBundleId.replace('.xctrunner', '');
|
|
1800
1806
|
this.log.info(`Installing prebuilt WDA at '${this.opts.prebuiltWDAPath}'. ` +
|
|
1801
1807
|
`Bundle identifier: ${candidateBundleId}.`);
|
|
1802
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1803
|
-
const device = this.opts.device;
|
|
1804
1808
|
// Note: The CFBundleVersion in the test bundle was always 1.
|
|
1805
1809
|
// It may not be able to compare with the installed versio.
|
|
1806
1810
|
if (this.isRealDevice()) {
|
|
1807
|
-
await
|
|
1811
|
+
await real_device_management_1.installToRealDevice.bind(this)(this.opts.prebuiltWDAPath, candidateBundleId, {
|
|
1808
1812
|
skipUninstall: true,
|
|
1809
1813
|
timeout: this.opts.appPushTimeout,
|
|
1810
1814
|
strategy: this.opts.appInstallStrategy,
|
|
1811
1815
|
});
|
|
1812
1816
|
}
|
|
1813
1817
|
else {
|
|
1814
|
-
await
|
|
1818
|
+
await simulator_management_1.installToSimulator.bind(this)(this.opts.prebuiltWDAPath, candidateBundleId);
|
|
1815
1819
|
}
|
|
1816
1820
|
}
|
|
1817
1821
|
}
|
|
@@ -1838,5 +1842,7 @@ exports.default = XCUITestDriver;
|
|
|
1838
1842
|
* @typedef {import('./commands/types').FullContext} FullContext
|
|
1839
1843
|
* @typedef {import('./types').WDACapabilities} WDACapabilities
|
|
1840
1844
|
* @typedef {import('appium-xcode').XcodeVersion} XcodeVersion
|
|
1841
|
-
|
|
1845
|
+
* @typedef {import('appium-ios-simulator').Simulator} Simulator
|
|
1846
|
+
* @typedef {import('./real-device').RealDevice} RealDevice
|
|
1847
|
+
*/
|
|
1842
1848
|
//# sourceMappingURL=driver.js.map
|