appium-xcuitest-driver 7.6.1 → 7.7.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 +7 -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 +75 -77
- 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 +79 -78
- 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 +7 -29
- 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":";0FAktEa,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;AA3iE/C;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAwG;CACzG;sCAvqEmC,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 {
|
|
@@ -1024,17 +1028,15 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1024
1028
|
}
|
|
1025
1029
|
/**
|
|
1026
1030
|
*
|
|
1027
|
-
* @param {
|
|
1031
|
+
* @param {boolean} [enforceSimulatorShutdown=false]
|
|
1028
1032
|
*/
|
|
1029
|
-
async runReset(
|
|
1033
|
+
async runReset(enforceSimulatorShutdown = false) {
|
|
1030
1034
|
this.logEvent('resetStarted');
|
|
1031
1035
|
if (this.isRealDevice()) {
|
|
1032
|
-
|
|
1033
|
-
await (0, real_device_management_1.runRealDeviceReset)(this.opts.device, opts || this.opts);
|
|
1036
|
+
await real_device_management_1.runRealDeviceReset.bind(this)();
|
|
1034
1037
|
}
|
|
1035
1038
|
else {
|
|
1036
|
-
|
|
1037
|
-
await (0, simulator_management_1.runSimulatorReset)(this.opts.device, opts || this.opts);
|
|
1039
|
+
await simulator_management_1.runSimulatorReset.bind(this)(enforceSimulatorShutdown);
|
|
1038
1040
|
}
|
|
1039
1041
|
this.logEvent('resetComplete');
|
|
1040
1042
|
}
|
|
@@ -1076,15 +1078,12 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1076
1078
|
await this.stopRemote();
|
|
1077
1079
|
}
|
|
1078
1080
|
if (this.opts.resetOnSessionStartOnly === false) {
|
|
1079
|
-
await this.runReset(
|
|
1080
|
-
enforceSimulatorShutdown: true,
|
|
1081
|
-
}));
|
|
1081
|
+
await this.runReset(true);
|
|
1082
1082
|
}
|
|
1083
|
-
|
|
1084
|
-
const simulatorDevice = this.isSimulator() ? this.opts.device : null;
|
|
1083
|
+
const simulatorDevice = this.isSimulator() ? /** @type {Simulator} */ (this.device) : null;
|
|
1085
1084
|
if (simulatorDevice && this.lifecycleData.createSim) {
|
|
1086
1085
|
this.log.debug(`Deleting simulator created for this run (udid: '${simulatorDevice.udid}')`);
|
|
1087
|
-
await
|
|
1086
|
+
await simulator_management_1.shutdownSimulator.bind(this)();
|
|
1088
1087
|
await simulatorDevice.delete();
|
|
1089
1088
|
}
|
|
1090
1089
|
const shouldResetLocationServivce = this.isRealDevice() && !!this.opts.resetLocationService;
|
|
@@ -1267,18 +1266,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1267
1266
|
// if we get generic names, translate them
|
|
1268
1267
|
this.opts.deviceName = (0, utils_1.translateDeviceName)(this.opts.platformVersion, this.opts.deviceName);
|
|
1269
1268
|
const setupVersionCaps = async () => {
|
|
1269
|
+
const iosSdkVersion = await (0, utils_1.getAndCheckIosSdkVersion)();
|
|
1270
1270
|
// @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}'. ` +
|
|
1271
|
+
this.opts.iosSdkVersion = iosSdkVersion;
|
|
1272
|
+
this.log.info(`iOS SDK Version set to '${iosSdkVersion}'`);
|
|
1273
|
+
if (!this.opts.platformVersion && iosSdkVersion) {
|
|
1274
|
+
this.log.info(`No platformVersion specified. Using the latest version Xcode supports: '${iosSdkVersion}'. ` +
|
|
1279
1275
|
`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);
|
|
1276
|
+
this.opts.platformVersion = (0, utils_1.normalizePlatformVersion)(iosSdkVersion);
|
|
1282
1277
|
}
|
|
1283
1278
|
};
|
|
1284
1279
|
if (this.opts.udid) {
|
|
@@ -1290,11 +1285,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1290
1285
|
// Trying to find matching UDID for Simulator
|
|
1291
1286
|
this.log.warn(`Cannot detect any connected real devices. Falling back to Simulator. Original error: ${err.message}`);
|
|
1292
1287
|
await setupVersionCaps();
|
|
1293
|
-
|
|
1294
|
-
const device = await (0, simulator_management_1.getExistingSim)(this.opts);
|
|
1288
|
+
const device = await simulator_management_1.getExistingSim.bind(this)();
|
|
1295
1289
|
if (!device) {
|
|
1296
1290
|
// No matching Simulator is found. Throw an error
|
|
1297
|
-
this.log.
|
|
1291
|
+
throw this.log.errorWithException(`Cannot detect udid for ${this.opts.deviceName} Simulator running iOS ${this.opts.platformVersion}`);
|
|
1298
1292
|
}
|
|
1299
1293
|
this.opts.udid = device.udid;
|
|
1300
1294
|
return { device, realDevice: false, udid: device.udid };
|
|
@@ -1316,6 +1310,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1316
1310
|
try {
|
|
1317
1311
|
const device = await (0, appium_ios_simulator_1.getSimulator)(this.opts.udid, {
|
|
1318
1312
|
devicesSetPath: this.opts.simulatorDevicesSetPath,
|
|
1313
|
+
logger: this.log,
|
|
1319
1314
|
});
|
|
1320
1315
|
return { device, realDevice: false, udid: this.opts.udid };
|
|
1321
1316
|
}
|
|
@@ -1325,7 +1320,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1325
1320
|
}
|
|
1326
1321
|
}
|
|
1327
1322
|
}
|
|
1328
|
-
const device =
|
|
1323
|
+
const device = real_device_management_1.getRealDeviceObj.bind(this)();
|
|
1329
1324
|
return { device, realDevice: true, udid: this.opts.udid };
|
|
1330
1325
|
}
|
|
1331
1326
|
this.log.info(`No real device udid has been provided in capabilities. ` +
|
|
@@ -1336,8 +1331,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1336
1331
|
}
|
|
1337
1332
|
else {
|
|
1338
1333
|
// figure out the correct simulator to use, given the desired capabilities
|
|
1339
|
-
|
|
1340
|
-
const device = await (0, simulator_management_1.getExistingSim)(this.opts);
|
|
1334
|
+
const device = await simulator_management_1.getExistingSim.bind(this)();
|
|
1341
1335
|
// check for an existing simulator
|
|
1342
1336
|
if (device) {
|
|
1343
1337
|
return { device, realDevice: false, udid: device.udid };
|
|
@@ -1349,19 +1343,20 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1349
1343
|
return { device, realDevice: false, udid: device.udid };
|
|
1350
1344
|
}
|
|
1351
1345
|
async startSim() {
|
|
1346
|
+
/** @type {import('appium-ios-simulator').DevicePreferences} */
|
|
1347
|
+
const devicePreferences = {};
|
|
1348
|
+
/** @type {import('appium-ios-simulator').RunOptions} */
|
|
1352
1349
|
const runOpts = {
|
|
1353
1350
|
scaleFactor: this.opts.scaleFactor,
|
|
1354
1351
|
connectHardwareKeyboard: !!this.opts.connectHardwareKeyboard,
|
|
1355
1352
|
pasteboardAutomaticSync: this.opts.simulatorPasteboardAutomaticSync ?? 'off',
|
|
1356
1353
|
isHeadless: !!this.opts.isHeadless,
|
|
1357
1354
|
tracePointer: this.opts.simulatorTracePointer,
|
|
1358
|
-
devicePreferences
|
|
1355
|
+
devicePreferences,
|
|
1359
1356
|
};
|
|
1360
1357
|
// 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;
|
|
1358
|
+
if (this.opts.simulatorWindowCenter) {
|
|
1359
|
+
devicePreferences.SimulatorWindowCenter = this.opts.simulatorWindowCenter;
|
|
1365
1360
|
}
|
|
1366
1361
|
if (lodash_1.default.isInteger(this.opts.simulatorStartupTimeout)) {
|
|
1367
1362
|
runOpts.startupTimeout = this.opts.simulatorStartupTimeout;
|
|
@@ -1371,21 +1366,20 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1371
1366
|
const orientation = lodash_1.default.isString(this.opts.orientation) && this.opts.orientation.toUpperCase();
|
|
1372
1367
|
switch (orientation) {
|
|
1373
1368
|
case 'LANDSCAPE':
|
|
1374
|
-
|
|
1375
|
-
|
|
1369
|
+
devicePreferences.SimulatorWindowOrientation = 'LandscapeLeft';
|
|
1370
|
+
devicePreferences.SimulatorWindowRotationAngle = 90;
|
|
1376
1371
|
break;
|
|
1377
1372
|
case 'PORTRAIT':
|
|
1378
|
-
|
|
1379
|
-
|
|
1373
|
+
devicePreferences.SimulatorWindowOrientation = 'Portrait';
|
|
1374
|
+
devicePreferences.SimulatorWindowRotationAngle = 0;
|
|
1380
1375
|
break;
|
|
1381
1376
|
}
|
|
1382
|
-
|
|
1383
|
-
await this.opts.device.run(runOpts);
|
|
1377
|
+
await /** @type {Simulator} */ (this.device).run(runOpts);
|
|
1384
1378
|
}
|
|
1385
1379
|
async createSim() {
|
|
1386
1380
|
this.lifecycleData.createSim = true;
|
|
1387
1381
|
// create sim for caps
|
|
1388
|
-
const sim = await
|
|
1382
|
+
const sim = await simulator_management_1.createSim.bind(this)();
|
|
1389
1383
|
this.log.info(`Created simulator with udid '${sim.udid}'.`);
|
|
1390
1384
|
return sim;
|
|
1391
1385
|
}
|
|
@@ -1695,16 +1689,14 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1695
1689
|
const { install, skipUninstall } = await this.checkAutInstallationState();
|
|
1696
1690
|
if (install) {
|
|
1697
1691
|
if (this.isRealDevice()) {
|
|
1698
|
-
|
|
1699
|
-
await (0, real_device_management_1.installToRealDevice)(this.opts.device, this.opts.app, this.opts.bundleId, {
|
|
1692
|
+
await real_device_management_1.installToRealDevice.bind(this)(this.opts.app, this.opts.bundleId, {
|
|
1700
1693
|
skipUninstall,
|
|
1701
1694
|
timeout: this.opts.appPushTimeout,
|
|
1702
1695
|
strategy: this.opts.appInstallStrategy,
|
|
1703
1696
|
});
|
|
1704
1697
|
}
|
|
1705
1698
|
else {
|
|
1706
|
-
|
|
1707
|
-
await (0, simulator_management_1.installToSimulator)(this.opts.device, this.opts.app, this.opts.bundleId, {
|
|
1699
|
+
await simulator_management_1.installToSimulator.bind(this)(this.opts.app, this.opts.bundleId, {
|
|
1708
1700
|
skipUninstall,
|
|
1709
1701
|
newSimulator: this.lifecycleData?.createSim,
|
|
1710
1702
|
});
|
|
@@ -1718,6 +1710,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1718
1710
|
this.logEvent('appInstalled');
|
|
1719
1711
|
}
|
|
1720
1712
|
}
|
|
1713
|
+
/**
|
|
1714
|
+
* @param {string|string[]} otherApps
|
|
1715
|
+
* @returns {Promise<void>}
|
|
1716
|
+
*/
|
|
1721
1717
|
async installOtherApps(otherApps) {
|
|
1722
1718
|
/** @type {string[]|undefined} */
|
|
1723
1719
|
let appsList;
|
|
@@ -1737,25 +1733,23 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1737
1733
|
const appIds = await bluebird_1.default.all(appPaths.map((appPath) => (0, app_utils_1.extractBundleId)(appPath)));
|
|
1738
1734
|
for (const [appId, appPath] of lodash_1.default.zip(appIds, appPaths)) {
|
|
1739
1735
|
if (this.isRealDevice()) {
|
|
1740
|
-
await
|
|
1741
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1742
|
-
this.opts.device, appPath, appId, {
|
|
1736
|
+
await real_device_management_1.installToRealDevice.bind(this)(appPath, appId, {
|
|
1743
1737
|
skipUninstall: true, // to make the behavior as same as UIA2
|
|
1744
1738
|
timeout: this.opts.appPushTimeout,
|
|
1745
1739
|
strategy: this.opts.appInstallStrategy,
|
|
1746
1740
|
});
|
|
1747
1741
|
}
|
|
1748
1742
|
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, {
|
|
1743
|
+
await simulator_management_1.installToSimulator.bind(this)(appPath, appId, {
|
|
1754
1744
|
newSimulator: this.lifecycleData.createSim,
|
|
1755
1745
|
});
|
|
1756
1746
|
}
|
|
1757
1747
|
}
|
|
1758
1748
|
}
|
|
1749
|
+
/**
|
|
1750
|
+
* @param {string} orientation
|
|
1751
|
+
* @returns {Promise<void>}
|
|
1752
|
+
*/
|
|
1759
1753
|
async setInitialOrientation(orientation) {
|
|
1760
1754
|
const dstOrientation = lodash_1.default.toUpper(orientation);
|
|
1761
1755
|
if (!SUPPORTED_ORIENATIONS.includes(dstOrientation)) {
|
|
@@ -1771,6 +1765,10 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1771
1765
|
this.log.warn(`Setting initial orientation failed with: ${err.message}`);
|
|
1772
1766
|
}
|
|
1773
1767
|
}
|
|
1768
|
+
/**
|
|
1769
|
+
* @param {string} [cmdName]
|
|
1770
|
+
* @returns {number|undefined}
|
|
1771
|
+
*/
|
|
1774
1772
|
_getCommandTimeout(cmdName) {
|
|
1775
1773
|
if (this.opts.commandTimeouts) {
|
|
1776
1774
|
if (cmdName && lodash_1.default.has(this.opts.commandTimeouts, cmdName)) {
|
|
@@ -1799,19 +1797,17 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1799
1797
|
this.wda.updatedWDABundleId = candidateBundleId.replace('.xctrunner', '');
|
|
1800
1798
|
this.log.info(`Installing prebuilt WDA at '${this.opts.prebuiltWDAPath}'. ` +
|
|
1801
1799
|
`Bundle identifier: ${candidateBundleId}.`);
|
|
1802
|
-
// @ts-expect-error - do not assign arbitrary properties to `this.opts`
|
|
1803
|
-
const device = this.opts.device;
|
|
1804
1800
|
// Note: The CFBundleVersion in the test bundle was always 1.
|
|
1805
1801
|
// It may not be able to compare with the installed versio.
|
|
1806
1802
|
if (this.isRealDevice()) {
|
|
1807
|
-
await
|
|
1803
|
+
await real_device_management_1.installToRealDevice.bind(this)(this.opts.prebuiltWDAPath, candidateBundleId, {
|
|
1808
1804
|
skipUninstall: true,
|
|
1809
1805
|
timeout: this.opts.appPushTimeout,
|
|
1810
1806
|
strategy: this.opts.appInstallStrategy,
|
|
1811
1807
|
});
|
|
1812
1808
|
}
|
|
1813
1809
|
else {
|
|
1814
|
-
await
|
|
1810
|
+
await simulator_management_1.installToSimulator.bind(this)(this.opts.prebuiltWDAPath, candidateBundleId);
|
|
1815
1811
|
}
|
|
1816
1812
|
}
|
|
1817
1813
|
}
|
|
@@ -1838,5 +1834,7 @@ exports.default = XCUITestDriver;
|
|
|
1838
1834
|
* @typedef {import('./commands/types').FullContext} FullContext
|
|
1839
1835
|
* @typedef {import('./types').WDACapabilities} WDACapabilities
|
|
1840
1836
|
* @typedef {import('appium-xcode').XcodeVersion} XcodeVersion
|
|
1841
|
-
|
|
1837
|
+
* @typedef {import('appium-ios-simulator').Simulator} Simulator
|
|
1838
|
+
* @typedef {import('./real-device').RealDevice} RealDevice
|
|
1839
|
+
*/
|
|
1842
1840
|
//# sourceMappingURL=driver.js.map
|