appium-xcuitest-driver 7.13.0 → 7.15.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 +14 -0
- package/build/lib/app-infos-cache.d.ts +46 -0
- package/build/lib/app-infos-cache.d.ts.map +1 -0
- package/build/lib/app-infos-cache.js +156 -0
- package/build/lib/app-infos-cache.js.map +1 -0
- package/build/lib/app-utils.d.ts +60 -51
- package/build/lib/app-utils.d.ts.map +1 -1
- package/build/lib/app-utils.js +496 -182
- package/build/lib/app-utils.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +5 -4
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +14 -7
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +5 -2
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +6 -3
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/file-movement.js +1 -1
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/types.d.ts +1 -0
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts +1 -1
- package/build/lib/desired-caps.d.ts +2 -0
- package/build/lib/desired-caps.d.ts.map +1 -1
- package/build/lib/desired-caps.js +1 -0
- package/build/lib/desired-caps.js.map +1 -1
- package/build/lib/driver.d.ts +35 -40
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +15 -99
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +1 -1
- package/build/lib/execute-method-map.js +1 -1
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/ios-fs-helpers.d.ts +30 -15
- package/build/lib/ios-fs-helpers.d.ts.map +1 -1
- package/build/lib/ios-fs-helpers.js +54 -21
- package/build/lib/ios-fs-helpers.js.map +1 -1
- package/build/lib/real-device-management.d.ts +0 -5
- package/build/lib/real-device-management.d.ts.map +1 -1
- package/build/lib/real-device-management.js +8 -5
- package/build/lib/real-device-management.js.map +1 -1
- package/build/lib/real-device.d.ts +13 -9
- package/build/lib/real-device.d.ts.map +1 -1
- package/build/lib/real-device.js +49 -75
- package/build/lib/real-device.js.map +1 -1
- package/lib/app-infos-cache.js +159 -0
- package/lib/app-utils.js +529 -193
- package/lib/commands/app-management.js +20 -9
- package/lib/commands/app-strings.js +6 -3
- package/lib/commands/file-movement.js +1 -1
- package/lib/commands/types.ts +1 -0
- package/lib/desired-caps.js +1 -0
- package/lib/driver.js +17 -120
- package/lib/execute-method-map.ts +1 -1
- package/lib/ios-fs-helpers.js +57 -23
- package/lib/real-device-management.js +7 -5
- package/lib/real-device.js +62 -88
- package/npm-shrinkwrap.json +40 -32
- package/package.json +2 -2
package/build/lib/driver.d.ts
CHANGED
|
@@ -260,13 +260,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
260
260
|
};
|
|
261
261
|
readonly safariGlobalPreferences: {
|
|
262
262
|
readonly isObject: true;
|
|
263
|
-
};
|
|
263
|
+
}; /** @type {import('@appium/types').RouteMatcher[]} */
|
|
264
264
|
readonly safariLogAllCommunication: {
|
|
265
265
|
readonly isBoolean: true;
|
|
266
266
|
};
|
|
267
267
|
readonly safariLogAllCommunicationHexDump: {
|
|
268
268
|
readonly isBoolean: true;
|
|
269
|
-
};
|
|
269
|
+
};
|
|
270
270
|
readonly safariSocketChunkSize: {
|
|
271
271
|
readonly isNumber: true;
|
|
272
272
|
};
|
|
@@ -328,12 +328,15 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
328
328
|
readonly resultBundlePath: {
|
|
329
329
|
readonly isString: true;
|
|
330
330
|
};
|
|
331
|
+
/**
|
|
332
|
+
* @type {boolean|undefined}
|
|
333
|
+
*/
|
|
331
334
|
readonly resultBundleVersion: {
|
|
332
335
|
readonly isNumber: true;
|
|
333
336
|
};
|
|
334
337
|
readonly safariIgnoreWebHostnames: {
|
|
335
338
|
readonly isString: true;
|
|
336
|
-
};
|
|
339
|
+
}; /** @type {string|null} */
|
|
337
340
|
readonly disableAutomaticScreenshots: {
|
|
338
341
|
readonly isBoolean: true;
|
|
339
342
|
};
|
|
@@ -347,12 +350,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
347
350
|
readonly isBoolean: true;
|
|
348
351
|
};
|
|
349
352
|
readonly appInstallStrategy: {
|
|
353
|
+
readonly deprecated: true;
|
|
350
354
|
readonly isString: true;
|
|
351
355
|
readonly inclusionCaseInsensitive: readonly ["serial", "parallel", "ios-deploy"];
|
|
352
356
|
};
|
|
353
357
|
readonly enforceAppInstall: {
|
|
354
358
|
readonly isBoolean: true;
|
|
355
|
-
};
|
|
359
|
+
};
|
|
356
360
|
readonly skipTriggerInputEventAfterSendkeys: {
|
|
357
361
|
readonly isBoolean: true;
|
|
358
362
|
};
|
|
@@ -368,7 +372,6 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
368
372
|
readonly appLaunchStateTimeoutSec: {
|
|
369
373
|
readonly isNumber: true;
|
|
370
374
|
};
|
|
371
|
-
/** @type {LRUCache} */
|
|
372
375
|
readonly appTimeZone: {
|
|
373
376
|
readonly isString: true;
|
|
374
377
|
};
|
|
@@ -628,13 +631,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
628
631
|
};
|
|
629
632
|
readonly safariGlobalPreferences: {
|
|
630
633
|
readonly isObject: true;
|
|
631
|
-
};
|
|
634
|
+
}; /** @type {import('@appium/types').RouteMatcher[]} */
|
|
632
635
|
readonly safariLogAllCommunication: {
|
|
633
636
|
readonly isBoolean: true;
|
|
634
637
|
};
|
|
635
638
|
readonly safariLogAllCommunicationHexDump: {
|
|
636
639
|
readonly isBoolean: true;
|
|
637
|
-
};
|
|
640
|
+
};
|
|
638
641
|
readonly safariSocketChunkSize: {
|
|
639
642
|
readonly isNumber: true;
|
|
640
643
|
};
|
|
@@ -696,12 +699,15 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
696
699
|
readonly resultBundlePath: {
|
|
697
700
|
readonly isString: true;
|
|
698
701
|
};
|
|
702
|
+
/**
|
|
703
|
+
* @type {boolean|undefined}
|
|
704
|
+
*/
|
|
699
705
|
readonly resultBundleVersion: {
|
|
700
706
|
readonly isNumber: true;
|
|
701
707
|
};
|
|
702
708
|
readonly safariIgnoreWebHostnames: {
|
|
703
709
|
readonly isString: true;
|
|
704
|
-
};
|
|
710
|
+
}; /** @type {string|null} */
|
|
705
711
|
readonly disableAutomaticScreenshots: {
|
|
706
712
|
readonly isBoolean: true;
|
|
707
713
|
};
|
|
@@ -715,12 +721,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
715
721
|
readonly isBoolean: true;
|
|
716
722
|
};
|
|
717
723
|
readonly appInstallStrategy: {
|
|
724
|
+
readonly deprecated: true;
|
|
718
725
|
readonly isString: true;
|
|
719
726
|
readonly inclusionCaseInsensitive: readonly ["serial", "parallel", "ios-deploy"];
|
|
720
727
|
};
|
|
721
728
|
readonly enforceAppInstall: {
|
|
722
729
|
readonly isBoolean: true;
|
|
723
|
-
};
|
|
730
|
+
};
|
|
724
731
|
readonly skipTriggerInputEventAfterSendkeys: {
|
|
725
732
|
readonly isBoolean: true;
|
|
726
733
|
};
|
|
@@ -736,7 +743,6 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
736
743
|
readonly appLaunchStateTimeoutSec: {
|
|
737
744
|
readonly isNumber: true;
|
|
738
745
|
};
|
|
739
|
-
/** @type {LRUCache} */
|
|
740
746
|
readonly appTimeZone: {
|
|
741
747
|
readonly isString: true;
|
|
742
748
|
};
|
|
@@ -1060,7 +1066,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1060
1066
|
readonly command: "mobileInstallApp";
|
|
1061
1067
|
readonly params: {
|
|
1062
1068
|
readonly required: readonly ["app"];
|
|
1063
|
-
readonly optional: readonly ["
|
|
1069
|
+
readonly optional: readonly ["timeoutMs", "checkVersion"];
|
|
1064
1070
|
};
|
|
1065
1071
|
};
|
|
1066
1072
|
readonly 'mobile: isAppInstalled': {
|
|
@@ -1131,9 +1137,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1131
1137
|
};
|
|
1132
1138
|
};
|
|
1133
1139
|
readonly 'mobile: stopPerfRecord': {
|
|
1134
|
-
readonly command: "mobileStopPerfRecord";
|
|
1135
|
-
* @type {boolean|undefined}
|
|
1136
|
-
*/
|
|
1140
|
+
readonly command: "mobileStopPerfRecord";
|
|
1137
1141
|
readonly params: {
|
|
1138
1142
|
readonly optional: readonly ["remotePath", "user", "pass", "method", "profileName", "headers", "fileFieldName", "formFields"];
|
|
1139
1143
|
};
|
|
@@ -1142,7 +1146,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1142
1146
|
readonly command: "mobileInstallCertificate";
|
|
1143
1147
|
readonly params: {
|
|
1144
1148
|
readonly required: readonly ["content"];
|
|
1145
|
-
readonly optional: readonly ["commonName", "isRoot"];
|
|
1149
|
+
readonly optional: readonly ["commonName", "isRoot"]; /** @type {((logRecord: {message: string}) => void)|null} */
|
|
1146
1150
|
};
|
|
1147
1151
|
};
|
|
1148
1152
|
readonly 'mobile: removeCertificate': {
|
|
@@ -1160,6 +1164,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1160
1164
|
readonly 'mobile: stopLogsBroadcast': {
|
|
1161
1165
|
readonly command: "mobileStopLogsBroadcast";
|
|
1162
1166
|
};
|
|
1167
|
+
/** @type {boolean|undefined} */
|
|
1163
1168
|
readonly 'mobile: batteryInfo': {
|
|
1164
1169
|
readonly command: "mobileGetBatteryInfo";
|
|
1165
1170
|
};
|
|
@@ -1170,6 +1175,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1170
1175
|
};
|
|
1171
1176
|
};
|
|
1172
1177
|
readonly 'mobile: deviceInfo': {
|
|
1178
|
+
/** @type {import('./commands/record-audio').AudioRecorder|null} */
|
|
1173
1179
|
readonly command: "mobileGetDeviceInfo";
|
|
1174
1180
|
};
|
|
1175
1181
|
readonly 'mobile: getDeviceTime': {
|
|
@@ -1180,11 +1186,12 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1180
1186
|
};
|
|
1181
1187
|
readonly 'mobile: activeAppInfo': {
|
|
1182
1188
|
readonly command: "mobileGetActiveAppInfo";
|
|
1183
|
-
};
|
|
1189
|
+
}; /** @type {Simulator|RealDevice} */
|
|
1184
1190
|
readonly 'mobile: deviceScreenInfo': {
|
|
1185
1191
|
readonly command: "getScreenInfo";
|
|
1186
1192
|
};
|
|
1187
1193
|
readonly 'mobile: pressButton': {
|
|
1194
|
+
/** @type {WebDriverAgent} */
|
|
1188
1195
|
readonly command: "mobilePressButton";
|
|
1189
1196
|
readonly params: {
|
|
1190
1197
|
readonly required: readonly ["name"];
|
|
@@ -1509,6 +1516,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1509
1516
|
pageSourceExcludedAttributes: string;
|
|
1510
1517
|
}>;
|
|
1511
1518
|
logs: {};
|
|
1519
|
+
appInfosCache: AppInfosCache;
|
|
1512
1520
|
onSettingsUpdate(key: any, value: any): Promise<unknown>;
|
|
1513
1521
|
resetIos(): void;
|
|
1514
1522
|
jwpProxyActive: boolean | undefined;
|
|
@@ -1789,13 +1797,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1789
1797
|
};
|
|
1790
1798
|
readonly safariGlobalPreferences: {
|
|
1791
1799
|
readonly isObject: true;
|
|
1792
|
-
};
|
|
1800
|
+
}; /** @type {import('@appium/types').RouteMatcher[]} */
|
|
1793
1801
|
readonly safariLogAllCommunication: {
|
|
1794
1802
|
readonly isBoolean: true;
|
|
1795
1803
|
};
|
|
1796
1804
|
readonly safariLogAllCommunicationHexDump: {
|
|
1797
1805
|
readonly isBoolean: true;
|
|
1798
|
-
};
|
|
1806
|
+
};
|
|
1799
1807
|
readonly safariSocketChunkSize: {
|
|
1800
1808
|
readonly isNumber: true;
|
|
1801
1809
|
};
|
|
@@ -1857,12 +1865,15 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1857
1865
|
readonly resultBundlePath: {
|
|
1858
1866
|
readonly isString: true;
|
|
1859
1867
|
};
|
|
1868
|
+
/**
|
|
1869
|
+
* @type {boolean|undefined}
|
|
1870
|
+
*/
|
|
1860
1871
|
readonly resultBundleVersion: {
|
|
1861
1872
|
readonly isNumber: true;
|
|
1862
1873
|
};
|
|
1863
1874
|
readonly safariIgnoreWebHostnames: {
|
|
1864
1875
|
readonly isString: true;
|
|
1865
|
-
};
|
|
1876
|
+
}; /** @type {string|null} */
|
|
1866
1877
|
readonly disableAutomaticScreenshots: {
|
|
1867
1878
|
readonly isBoolean: true;
|
|
1868
1879
|
};
|
|
@@ -1876,12 +1887,13 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1876
1887
|
readonly isBoolean: true;
|
|
1877
1888
|
};
|
|
1878
1889
|
readonly appInstallStrategy: {
|
|
1890
|
+
readonly deprecated: true;
|
|
1879
1891
|
readonly isString: true;
|
|
1880
1892
|
readonly inclusionCaseInsensitive: readonly ["serial", "parallel", "ios-deploy"];
|
|
1881
1893
|
};
|
|
1882
1894
|
readonly enforceAppInstall: {
|
|
1883
1895
|
readonly isBoolean: true;
|
|
1884
|
-
};
|
|
1896
|
+
};
|
|
1885
1897
|
readonly skipTriggerInputEventAfterSendkeys: {
|
|
1886
1898
|
readonly isBoolean: true;
|
|
1887
1899
|
};
|
|
@@ -1897,7 +1909,6 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1897
1909
|
readonly appLaunchStateTimeoutSec: {
|
|
1898
1910
|
readonly isNumber: true;
|
|
1899
1911
|
};
|
|
1900
|
-
/** @type {LRUCache} */
|
|
1901
1912
|
readonly appTimeZone: {
|
|
1902
1913
|
readonly isString: true;
|
|
1903
1914
|
};
|
|
@@ -1932,23 +1943,6 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
1932
1943
|
*/
|
|
1933
1944
|
executeCommand(cmd: string, ...args: any[]): Promise<any>;
|
|
1934
1945
|
configureApp(): Promise<void>;
|
|
1935
|
-
/**
|
|
1936
|
-
* Unzip the given archive and find a matching .app bundle in it
|
|
1937
|
-
*
|
|
1938
|
-
* @param {string} appPath The path to the archive.
|
|
1939
|
-
* @param {number} depth [0] the current nesting depth. App bundles whose nesting level
|
|
1940
|
-
* is greater than 1 are not supported.
|
|
1941
|
-
* @returns {Promise<string>} Full path to the first matching .app bundle..
|
|
1942
|
-
* @throws If no matching .app bundles were found in the provided archive.
|
|
1943
|
-
*/
|
|
1944
|
-
unzipApp(appPath: string, depth?: number): Promise<string>;
|
|
1945
|
-
onPostConfigureApp({ cachedAppInfo, isUrl, appPath }: {
|
|
1946
|
-
cachedAppInfo: any;
|
|
1947
|
-
isUrl: any;
|
|
1948
|
-
appPath: any;
|
|
1949
|
-
}): Promise<false | {
|
|
1950
|
-
appPath: any;
|
|
1951
|
-
}>;
|
|
1952
1946
|
determineDevice(): Promise<{
|
|
1953
1947
|
device: any;
|
|
1954
1948
|
realDevice: boolean;
|
|
@@ -2011,7 +2005,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
2011
2005
|
}) => Promise<void>;
|
|
2012
2006
|
getAlertButtons: (this: XCUITestDriver) => Promise<string[]>;
|
|
2013
2007
|
mobileHandleAlert: (this: XCUITestDriver, action: import("./commands/alert").AlertAction, buttonLabel?: string | undefined) => Promise<void | string[]>;
|
|
2014
|
-
mobileInstallApp: (this: XCUITestDriver, app: string, timeoutMs?: number | undefined,
|
|
2008
|
+
mobileInstallApp: (this: XCUITestDriver, app: string, timeoutMs?: number | undefined, checkVersion?: boolean | undefined) => Promise<void>;
|
|
2015
2009
|
mobileIsAppInstalled: (this: XCUITestDriver, bundleId: string) => Promise<boolean>;
|
|
2016
2010
|
mobileRemoveApp: (this: XCUITestDriver, bundleId: string) => Promise<boolean>;
|
|
2017
2011
|
mobileLaunchApp: (this: XCUITestDriver, bundleId: string, args?: string | string[] | undefined, environment?: any) => Promise<void>;
|
|
@@ -3601,7 +3595,7 @@ export class XCUITestDriver extends BaseDriver<{
|
|
|
3601
3595
|
mobileListXCTestsInTestBundle: (this: XCUITestDriver, bundle: string) => Promise<string[]>;
|
|
3602
3596
|
mobileStartXctestScreenRecording: (this: XCUITestDriver, fps?: number | undefined, codec?: number | undefined) => Promise<import("./commands/xctest-record-screen").XcTestScreenRecordingInfo>;
|
|
3603
3597
|
mobileGetXctestScreenRecordingInfo: () => Promise<import("./commands/xctest-record-screen").XcTestScreenRecordingInfo | null>;
|
|
3604
|
-
mobileStopXctestScreenRecording: (this: XCUITestDriver, remotePath?: string | undefined, user?: string | undefined, pass?: string | undefined, headers?: import("@appium/types").HTTPHeaders | undefined, fileFieldName?: string | undefined, formFields?: [string, any][] | Record<string, any> | undefined, method?: "
|
|
3598
|
+
mobileStopXctestScreenRecording: (this: XCUITestDriver, remotePath?: string | undefined, user?: string | undefined, pass?: string | undefined, headers?: import("@appium/types").HTTPHeaders | undefined, fileFieldName?: string | undefined, formFields?: [string, any][] | Record<string, any> | undefined, method?: "POST" | "PUT" | "PATCH" | undefined) => Promise<import("./commands/xctest-record-screen").XcTestScreenRecording>;
|
|
3605
3599
|
}
|
|
3606
3600
|
export default XCUITestDriver;
|
|
3607
3601
|
export type ExternalDriver<C extends import("@appium/types").Constraints, Ctx = string> = import('@appium/types').ExternalDriver<C, Ctx>;
|
|
@@ -3626,6 +3620,7 @@ import { LRUCache } from 'lru-cache';
|
|
|
3626
3620
|
import { RealDevice } from './real-device';
|
|
3627
3621
|
import { WebDriverAgent } from 'appium-webdriveragent';
|
|
3628
3622
|
import { DeviceSettings } from 'appium/driver';
|
|
3623
|
+
import { AppInfosCache } from './app-infos-cache';
|
|
3629
3624
|
import { mjpeg } from 'appium/support';
|
|
3630
3625
|
import { desiredCapConstraints } from './desired-caps';
|
|
3631
3626
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":"
|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/E,+DAAmD;IACnD,8GAA+D;IAC/D,0DAAqD;IACrD,2EAAiD;IACjD,uEAAmD;IACnD,sDAAiE;IACjE,qHAAuH;IACvH,+HAAqF;IAKrF,oTAA4D;IAC5D,sFAAgF;IAChF,qEAA4E;IAC5E,2FAAwF;IAKxF,+LAA0G;IAC1G,8HAA8G;IAC9G,yaAAwG;CACzG;;0FAgBY,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC;0CAI9C,KAAK,kBAAkB,EAAE,mBAAmB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;;;;;aAK3F,OAAO;;;;mBACP,OAAO;;wCAIR,4BAA4B;iCAC5B,OAAO,eAAe,EAAE,UAAU,CAAC,yBAAyB,CAAC;0BAC7D,OAAO,kBAAkB,EAAE,WAAW;2BACtC,OAAO,cAAc,EAAE,YAAY;wBACnC,OAAO,sBAAsB,EAAE,SAAS;2BA9nEJ,eAAe;yBAMzC,WAAW;2BA0B3B,eAAe;+BAjCO,uBAAuB;+BACH,eAAe;8BA2DlC,mBAAmB;sBA1DX,gBAAgB;sCAiBlB,gBAAgB"}
|
package/build/lib/driver.js
CHANGED
|
@@ -28,10 +28,9 @@ const real_device_management_1 = require("./real-device-management");
|
|
|
28
28
|
const real_device_1 = require("./real-device");
|
|
29
29
|
const simulator_management_1 = require("./simulator-management");
|
|
30
30
|
const utils_1 = require("./utils");
|
|
31
|
+
const app_infos_cache_1 = require("./app-infos-cache");
|
|
31
32
|
const SHUTDOWN_OTHER_FEAT_NAME = 'shutdown_other_sims';
|
|
32
33
|
const CUSTOMIZE_RESULT_BUNDLE_PATH = 'customize_result_bundle_path';
|
|
33
|
-
const SUPPORTED_EXTENSIONS = [app_utils_1.IPA_EXT, app_utils_1.APP_EXT];
|
|
34
|
-
const MAX_ARCHIVE_SCAN_DEPTH = 1;
|
|
35
34
|
const defaultServerCaps = {
|
|
36
35
|
webStorageEnabled: false,
|
|
37
36
|
locationContextEnabled: false,
|
|
@@ -543,6 +542,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
543
542
|
}
|
|
544
543
|
this.lifecycleData = {};
|
|
545
544
|
this._audioRecorder = null;
|
|
545
|
+
this.appInfosCache = new app_infos_cache_1.AppInfosCache(this.log);
|
|
546
546
|
}
|
|
547
547
|
async onSettingsUpdate(key, value) {
|
|
548
548
|
// skip sending the update request to the WDA nor saving it in opts
|
|
@@ -745,7 +745,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
745
745
|
if (this.opts.app) {
|
|
746
746
|
await (0, utils_1.checkAppPresent)(this.opts.app);
|
|
747
747
|
if (!this.opts.bundleId) {
|
|
748
|
-
this.opts.bundleId = await
|
|
748
|
+
this.opts.bundleId = await this.appInfosCache.extractBundleId(this.opts.app);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
await this.runReset();
|
|
@@ -1176,93 +1176,11 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1176
1176
|
return;
|
|
1177
1177
|
}
|
|
1178
1178
|
this.opts.app = await this.helpers.configureApp(this.opts.app, {
|
|
1179
|
-
onPostProcess:
|
|
1180
|
-
|
|
1179
|
+
onPostProcess: app_utils_1.onPostConfigureApp.bind(this),
|
|
1180
|
+
onDownload: app_utils_1.onDownloadApp.bind(this),
|
|
1181
|
+
supportedExtensions: app_utils_1.SUPPORTED_EXTENSIONS,
|
|
1181
1182
|
});
|
|
1182
1183
|
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Unzip the given archive and find a matching .app bundle in it
|
|
1185
|
-
*
|
|
1186
|
-
* @param {string} appPath The path to the archive.
|
|
1187
|
-
* @param {number} depth [0] the current nesting depth. App bundles whose nesting level
|
|
1188
|
-
* is greater than 1 are not supported.
|
|
1189
|
-
* @returns {Promise<string>} Full path to the first matching .app bundle..
|
|
1190
|
-
* @throws If no matching .app bundles were found in the provided archive.
|
|
1191
|
-
*/
|
|
1192
|
-
async unzipApp(appPath, depth = 0) {
|
|
1193
|
-
if (depth > MAX_ARCHIVE_SCAN_DEPTH) {
|
|
1194
|
-
throw new Error('Nesting of package bundles is not supported');
|
|
1195
|
-
}
|
|
1196
|
-
const [rootDir, matchedPaths] = await (0, app_utils_1.findApps)(appPath, SUPPORTED_EXTENSIONS);
|
|
1197
|
-
if (lodash_1.default.isEmpty(matchedPaths)) {
|
|
1198
|
-
this.log.debug(`'${node_path_1.default.basename(appPath)}' has no bundles`);
|
|
1199
|
-
}
|
|
1200
|
-
else {
|
|
1201
|
-
this.log.debug(`Found ${support_1.util.pluralize('bundle', matchedPaths.length, true)} in ` +
|
|
1202
|
-
`'${node_path_1.default.basename(appPath)}': ${matchedPaths}`);
|
|
1203
|
-
}
|
|
1204
|
-
try {
|
|
1205
|
-
for (const matchedPath of matchedPaths) {
|
|
1206
|
-
const fullPath = node_path_1.default.join(rootDir, matchedPath);
|
|
1207
|
-
if (await (0, app_utils_1.isAppBundle)(fullPath)) {
|
|
1208
|
-
const supportedPlatforms = await (0, app_utils_1.fetchSupportedAppPlatforms)(fullPath);
|
|
1209
|
-
if (this.isSimulator() && !supportedPlatforms.some((p) => lodash_1.default.includes(p, 'Simulator'))) {
|
|
1210
|
-
this.log.info(`'${matchedPath}' does not have Simulator devices in the list of supported platforms ` +
|
|
1211
|
-
`(${supportedPlatforms.join(',')}). Skipping it`);
|
|
1212
|
-
continue;
|
|
1213
|
-
}
|
|
1214
|
-
if (this.isRealDevice() && !supportedPlatforms.some((p) => lodash_1.default.includes(p, 'OS'))) {
|
|
1215
|
-
this.log.info(`'${matchedPath}' does not have real devices in the list of supported platforms ` +
|
|
1216
|
-
`(${supportedPlatforms.join(',')}). Skipping it`);
|
|
1217
|
-
continue;
|
|
1218
|
-
}
|
|
1219
|
-
this.log.info(`'${matchedPath}' is the resulting application bundle selected from '${appPath}'`);
|
|
1220
|
-
return await (0, app_utils_1.isolateAppBundle)(fullPath);
|
|
1221
|
-
}
|
|
1222
|
-
else if (lodash_1.default.endsWith(lodash_1.default.toLower(fullPath), app_utils_1.IPA_EXT) && (await support_1.fs.stat(fullPath)).isFile()) {
|
|
1223
|
-
try {
|
|
1224
|
-
return await this.unzipApp(fullPath, depth + 1);
|
|
1225
|
-
}
|
|
1226
|
-
catch (e) {
|
|
1227
|
-
this.log.warn(`Skipping processing of '${matchedPath}': ${e.message}`);
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
finally {
|
|
1233
|
-
await support_1.fs.rimraf(rootDir);
|
|
1234
|
-
}
|
|
1235
|
-
throw new Error(`${this.opts.app} did not have any matching ${app_utils_1.APP_EXT} or ${app_utils_1.IPA_EXT} ` +
|
|
1236
|
-
`bundles. Please make sure the provided package is valid and contains at least one matching ` +
|
|
1237
|
-
`application bundle which is not nested.`);
|
|
1238
|
-
}
|
|
1239
|
-
async onPostConfigureApp({ cachedAppInfo, isUrl, appPath }) {
|
|
1240
|
-
// Pick the previously cached entry if its integrity has been preserved
|
|
1241
|
-
if (lodash_1.default.isPlainObject(cachedAppInfo) &&
|
|
1242
|
-
(await support_1.fs.stat(appPath)).isFile() &&
|
|
1243
|
-
(await support_1.fs.hash(appPath)) === cachedAppInfo.packageHash &&
|
|
1244
|
-
(await support_1.fs.exists(cachedAppInfo.fullPath)) &&
|
|
1245
|
-
(await support_1.fs.glob('**/*', {
|
|
1246
|
-
cwd: cachedAppInfo.fullPath,
|
|
1247
|
-
})).length === cachedAppInfo.integrity.folder) {
|
|
1248
|
-
this.log.info(`Using '${cachedAppInfo.fullPath}' which was cached from '${appPath}'`);
|
|
1249
|
-
return { appPath: cachedAppInfo.fullPath };
|
|
1250
|
-
}
|
|
1251
|
-
// Only local .app bundles that are available in-place should not be cached
|
|
1252
|
-
if (await (0, app_utils_1.isAppBundle)(appPath)) {
|
|
1253
|
-
return false;
|
|
1254
|
-
}
|
|
1255
|
-
// Extract the app bundle and cache it
|
|
1256
|
-
try {
|
|
1257
|
-
return { appPath: await this.unzipApp(appPath) };
|
|
1258
|
-
}
|
|
1259
|
-
finally {
|
|
1260
|
-
// Cleanup previously downloaded archive
|
|
1261
|
-
if (isUrl) {
|
|
1262
|
-
await support_1.fs.rimraf(appPath);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
1184
|
async determineDevice() {
|
|
1267
1185
|
// in the one case where we create a sim, we will set this state
|
|
1268
1186
|
this.lifecycleData.createSim = false;
|
|
@@ -1626,7 +1544,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1626
1544
|
skipUninstall: !wasAppInstalled,
|
|
1627
1545
|
};
|
|
1628
1546
|
}
|
|
1629
|
-
const candidateBundleVersion = await
|
|
1547
|
+
const candidateBundleVersion = await this.appInfosCache.extractBundleVersion(app);
|
|
1630
1548
|
this.log.debug(`CFBundleVersion from Info.plist: ${candidateBundleVersion}`);
|
|
1631
1549
|
if (!candidateBundleVersion) {
|
|
1632
1550
|
return {
|
|
@@ -1676,17 +1594,13 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1676
1594
|
if (this.isSafari() || !this.opts.app) {
|
|
1677
1595
|
return;
|
|
1678
1596
|
}
|
|
1679
|
-
await
|
|
1680
|
-
isSimulator: this.isSimulator(),
|
|
1681
|
-
isTvOS: (0, utils_1.isTvOs)(this.opts.platformName),
|
|
1682
|
-
});
|
|
1597
|
+
await app_utils_1.verifyApplicationPlatform.bind(this)();
|
|
1683
1598
|
const { install, skipUninstall } = await this.checkAutInstallationState();
|
|
1684
1599
|
if (install) {
|
|
1685
1600
|
if (this.isRealDevice()) {
|
|
1686
1601
|
await real_device_management_1.installToRealDevice.bind(this)(this.opts.app, this.opts.bundleId, {
|
|
1687
1602
|
skipUninstall,
|
|
1688
1603
|
timeout: this.opts.appPushTimeout,
|
|
1689
|
-
strategy: this.opts.appInstallStrategy,
|
|
1690
1604
|
});
|
|
1691
1605
|
}
|
|
1692
1606
|
else {
|
|
@@ -1722,15 +1636,18 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1722
1636
|
return;
|
|
1723
1637
|
}
|
|
1724
1638
|
/** @type {string[]} */
|
|
1725
|
-
const appPaths = await bluebird_1.default.all(appsList.map((app) => this.helpers.configureApp(app,
|
|
1639
|
+
const appPaths = await bluebird_1.default.all(appsList.map((app) => this.helpers.configureApp(app, {
|
|
1640
|
+
onPostProcess: app_utils_1.onPostConfigureApp.bind(this),
|
|
1641
|
+
onDownload: app_utils_1.onDownloadApp.bind(this),
|
|
1642
|
+
supportedExtensions: app_utils_1.SUPPORTED_EXTENSIONS,
|
|
1643
|
+
})));
|
|
1726
1644
|
/** @type {string[]} */
|
|
1727
|
-
const appIds = await bluebird_1.default.all(appPaths.map((appPath) =>
|
|
1645
|
+
const appIds = await bluebird_1.default.all(appPaths.map((appPath) => this.appInfosCache.extractBundleId(appPath)));
|
|
1728
1646
|
for (const [appId, appPath] of lodash_1.default.zip(appIds, appPaths)) {
|
|
1729
1647
|
if (this.isRealDevice()) {
|
|
1730
1648
|
await real_device_management_1.installToRealDevice.bind(this)(appPath, appId, {
|
|
1731
1649
|
skipUninstall: true, // to make the behavior as same as UIA2
|
|
1732
1650
|
timeout: this.opts.appPushTimeout,
|
|
1733
|
-
strategy: this.opts.appInstallStrategy,
|
|
1734
1651
|
});
|
|
1735
1652
|
}
|
|
1736
1653
|
else {
|
|
@@ -1787,7 +1704,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1787
1704
|
if (!this.opts.prebuiltWDAPath) {
|
|
1788
1705
|
return;
|
|
1789
1706
|
}
|
|
1790
|
-
const candidateBundleId = await
|
|
1707
|
+
const candidateBundleId = await this.appInfosCache.extractBundleId(this.opts.prebuiltWDAPath);
|
|
1791
1708
|
this.wda.updatedWDABundleId = candidateBundleId.replace('.xctrunner', '');
|
|
1792
1709
|
this.log.info(`Installing prebuilt WDA at '${this.opts.prebuiltWDAPath}'. ` +
|
|
1793
1710
|
`Bundle identifier: ${candidateBundleId}.`);
|
|
@@ -1797,7 +1714,6 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
1797
1714
|
await real_device_management_1.installToRealDevice.bind(this)(this.opts.prebuiltWDAPath, candidateBundleId, {
|
|
1798
1715
|
skipUninstall: true,
|
|
1799
1716
|
timeout: this.opts.appPushTimeout,
|
|
1800
|
-
strategy: this.opts.appInstallStrategy,
|
|
1801
1717
|
});
|
|
1802
1718
|
}
|
|
1803
1719
|
else {
|