appium-xcuitest-driver 7.14.0 → 7.15.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/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 +32 -52
- package/build/lib/app-utils.d.ts.map +1 -1
- package/build/lib/app-utils.js +327 -219
- 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 +30 -27
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +12 -12
- 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 +357 -239
- 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 +12 -15
- 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 +13 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [7.15.1](https://github.com/appium/appium-xcuitest-driver/compare/v7.15.0...v7.15.1) (2024-04-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Update caching logic for extracted app bundles ([#2389](https://github.com/appium/appium-xcuitest-driver/issues/2389)) ([0424193](https://github.com/appium/appium-xcuitest-driver/commit/04241937414ee6fa986be8719fbb690046b63a56))
|
|
7
|
+
|
|
8
|
+
## [7.15.0](https://github.com/appium/appium-xcuitest-driver/compare/v7.14.0...v7.15.0) (2024-04-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Avoid unzipping of real device .ipa bundles ([#2388](https://github.com/appium/appium-xcuitest-driver/issues/2388)) ([520168a](https://github.com/appium/appium-xcuitest-driver/commit/520168aa7d8c230a44da136b9e8d21971c4ef8f8))
|
|
14
|
+
|
|
1
15
|
## [7.14.0](https://github.com/appium/appium-xcuitest-driver/compare/v7.13.0...v7.14.0) (2024-04-23)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class AppInfosCache {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('@appium/types').AppiumLogger} log
|
|
4
|
+
*/
|
|
5
|
+
constructor(log: import('@appium/types').AppiumLogger);
|
|
6
|
+
log: import("@appium/types").AppiumLogger;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {string} appPath
|
|
10
|
+
* @param {string} propertyName
|
|
11
|
+
* @returns {Promise<any>}
|
|
12
|
+
*/
|
|
13
|
+
extractManifestProperty(appPath: string, propertyName: string): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {string} appPath
|
|
17
|
+
* @returns {Promise<string>}
|
|
18
|
+
*/
|
|
19
|
+
extractBundleId(appPath: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param {string} appPath
|
|
23
|
+
* @returns {Promise<string>}
|
|
24
|
+
*/
|
|
25
|
+
extractBundleVersion(appPath: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {string} appPath
|
|
29
|
+
* @returns {Promise<string[]>}
|
|
30
|
+
*/
|
|
31
|
+
extractAppPlatforms(appPath: string): Promise<string[]>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {string} appPath
|
|
35
|
+
* @returns {Promise<string>}
|
|
36
|
+
*/
|
|
37
|
+
extractExecutableName(appPath: string): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param {string} appPath Full path to the .ipa or .app bundle
|
|
41
|
+
* @returns {Promise<import('@appium/types').StringRecord>} The payload of the manifest plist
|
|
42
|
+
* @throws {Error} If the given app is not a valid bundle
|
|
43
|
+
*/
|
|
44
|
+
put(appPath: string): Promise<import('@appium/types').StringRecord>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=app-infos-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-infos-cache.d.ts","sourceRoot":"","sources":["../../lib/app-infos-cache.js"],"names":[],"mappings":"AAcA;IACE;;OAEG;IACH,iBAFW,OAAO,eAAe,EAAE,YAAY,EAI9C;IADC,0CAAc;IAGhB;;;;;OAKG;IACH,iCAJW,MAAM,gBACN,MAAM,GACJ,QAAQ,GAAG,CAAC,CAMxB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAI3B;IAED;;;;OAIG;IACH,8BAHW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAI3B;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,QAAQ,MAAM,EAAE,CAAC,CAQ7B;IAED;;;;OAIG;IACH,+BAHW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAI3B;IAED;;;;;OAKG;IACH,aAJW,MAAM,GACJ,QAAQ,OAAO,eAAe,EAAE,YAAY,CAAC,CAgFzD;CACF"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AppInfosCache = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const support_1 = require("appium/support");
|
|
10
|
+
const lru_cache_1 = require("lru-cache");
|
|
11
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
12
|
+
/** @type {LRUCache<string, import('@appium/types').StringRecord>} */
|
|
13
|
+
const MANIFEST_CACHE = new lru_cache_1.LRUCache({
|
|
14
|
+
max: 40,
|
|
15
|
+
updateAgeOnHas: true,
|
|
16
|
+
});
|
|
17
|
+
const MANIFEST_FILE_NAME = 'Info.plist';
|
|
18
|
+
const MAX_MANIFEST_SIZE = 1024 * 1024; // 1 MiB
|
|
19
|
+
class AppInfosCache {
|
|
20
|
+
/**
|
|
21
|
+
* @param {import('@appium/types').AppiumLogger} log
|
|
22
|
+
*/
|
|
23
|
+
constructor(log) {
|
|
24
|
+
this.log = log;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {string} appPath
|
|
29
|
+
* @param {string} propertyName
|
|
30
|
+
* @returns {Promise<any>}
|
|
31
|
+
*/
|
|
32
|
+
async extractManifestProperty(appPath, propertyName) {
|
|
33
|
+
const result = (await this.put(appPath))[propertyName];
|
|
34
|
+
this.log.debug(`${propertyName}: ${JSON.stringify(result)}`);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param {string} appPath
|
|
40
|
+
* @returns {Promise<string>}
|
|
41
|
+
*/
|
|
42
|
+
async extractBundleId(appPath) {
|
|
43
|
+
return await this.extractManifestProperty(appPath, 'CFBundleIdentifier');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {string} appPath
|
|
48
|
+
* @returns {Promise<string>}
|
|
49
|
+
*/
|
|
50
|
+
async extractBundleVersion(appPath) {
|
|
51
|
+
return await this.extractManifestProperty(appPath, 'CFBundleVersion');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {string} appPath
|
|
56
|
+
* @returns {Promise<string[]>}
|
|
57
|
+
*/
|
|
58
|
+
async extractAppPlatforms(appPath) {
|
|
59
|
+
const result = await this.extractManifestProperty(appPath, 'CFBundleSupportedPlatforms');
|
|
60
|
+
if (!Array.isArray(result)) {
|
|
61
|
+
throw new Error(`${path_1.default.basename(appPath)}': CFBundleSupportedPlatforms is not a valid list`);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param {string} appPath
|
|
68
|
+
* @returns {Promise<string>}
|
|
69
|
+
*/
|
|
70
|
+
async extractExecutableName(appPath) {
|
|
71
|
+
return await this.extractManifestProperty(appPath, 'CFBundleExecutable');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param {string} appPath Full path to the .ipa or .app bundle
|
|
76
|
+
* @returns {Promise<import('@appium/types').StringRecord>} The payload of the manifest plist
|
|
77
|
+
* @throws {Error} If the given app is not a valid bundle
|
|
78
|
+
*/
|
|
79
|
+
async put(appPath) {
|
|
80
|
+
const readPlist = async (/** @type {string} */ plistPath) => {
|
|
81
|
+
try {
|
|
82
|
+
return await support_1.plist.parsePlistFile(plistPath);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
this.log.debug(e.stack);
|
|
86
|
+
throw new Error(`Cannot parse ${MANIFEST_FILE_NAME} of '${appPath}'. Is it a valid application bundle?`);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
if ((await support_1.fs.stat(appPath)).isFile()) {
|
|
90
|
+
/** @type {import('@appium/types').StringRecord|undefined} */
|
|
91
|
+
let manifestPayload;
|
|
92
|
+
/** @type {Error|undefined} */
|
|
93
|
+
let lastError;
|
|
94
|
+
try {
|
|
95
|
+
await support_1.zip.readEntries(appPath, async ({ entry, extractEntryTo }) => {
|
|
96
|
+
if (!lodash_1.default.endsWith(entry.fileName, `.app/${MANIFEST_FILE_NAME}`)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
const hash = `${entry.crc32}`;
|
|
100
|
+
if (MANIFEST_CACHE.has(hash)) {
|
|
101
|
+
manifestPayload = MANIFEST_CACHE.get(hash);
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const tmpRoot = await support_1.tempDir.openDir();
|
|
105
|
+
try {
|
|
106
|
+
await extractEntryTo(tmpRoot);
|
|
107
|
+
const plistPath = path_1.default.resolve(tmpRoot, entry.fileName);
|
|
108
|
+
manifestPayload = await readPlist(plistPath);
|
|
109
|
+
if (entry.uncompressedSize <= MAX_MANIFEST_SIZE && lodash_1.default.isPlainObject(manifestPayload)) {
|
|
110
|
+
this.log.debug(`Caching the manifest for ${manifestPayload?.CFBundleIdentifier} app ` +
|
|
111
|
+
`from an archived source using the key '${hash}'`);
|
|
112
|
+
MANIFEST_CACHE.set(hash, manifestPayload);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
this.log.debug(e.stack);
|
|
117
|
+
lastError = e;
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
await support_1.fs.rimraf(tmpRoot);
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
this.log.debug(e.stack);
|
|
127
|
+
throw new Error(`Cannot find ${MANIFEST_FILE_NAME} in '${appPath}'. Is it a valid application bundle?`);
|
|
128
|
+
}
|
|
129
|
+
if (!manifestPayload) {
|
|
130
|
+
let errorMessage = `Cannot extract ${MANIFEST_FILE_NAME} from '${appPath}'. Is it a valid application bundle?`;
|
|
131
|
+
if (lastError) {
|
|
132
|
+
errorMessage += ` Original error: ${lastError.message}`;
|
|
133
|
+
}
|
|
134
|
+
throw new Error(errorMessage);
|
|
135
|
+
}
|
|
136
|
+
return manifestPayload;
|
|
137
|
+
}
|
|
138
|
+
// appPath points to a folder
|
|
139
|
+
const manifestPath = path_1.default.join(appPath, MANIFEST_FILE_NAME);
|
|
140
|
+
const hash = await support_1.fs.hash(manifestPath);
|
|
141
|
+
if (MANIFEST_CACHE.has(hash)) {
|
|
142
|
+
return /** @type {import('@appium/types').StringRecord} */ (MANIFEST_CACHE.get(hash));
|
|
143
|
+
}
|
|
144
|
+
const [payload, stat] = await bluebird_1.default.all([
|
|
145
|
+
readPlist(manifestPath),
|
|
146
|
+
support_1.fs.stat(manifestPath),
|
|
147
|
+
]);
|
|
148
|
+
if (stat.size <= MAX_MANIFEST_SIZE && lodash_1.default.isPlainObject(payload)) {
|
|
149
|
+
this.log.debug(`Caching the manifest for ${payload.CFBundleIdentifier} app from a file source using the key '${hash}'`);
|
|
150
|
+
MANIFEST_CACHE.set(hash, payload);
|
|
151
|
+
}
|
|
152
|
+
return payload;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.AppInfosCache = AppInfosCache;
|
|
156
|
+
//# sourceMappingURL=app-infos-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-infos-cache.js","sourceRoot":"","sources":["../../lib/app-infos-cache.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,gDAAwB;AACxB,4CAAuD;AACvD,yCAAmC;AACnC,wDAAyB;AAEzB,qEAAqE;AACrE,MAAM,cAAc,GAAG,IAAI,oBAAQ,CAAC;IAClC,GAAG,EAAE,EAAE;IACP,cAAc,EAAE,IAAI;CACrB,CAAC,CAAC;AACH,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE/C,MAAa,aAAa;IACxB;;OAEG;IACH,YAAa,GAAG;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAAE,OAAO,EAAE,YAAY;QAClD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAE,OAAO;QAC5B,OAAO,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAC3E,CAAC;IAED;;;;OAIG;IACH,KAAK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CACZ,4BAA4B,OAAO,CAAC,kBAAkB,0CAA0C,IAAI,GAAG,CACxG,CAAC;YACF,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAhJD,sCAgJC"}
|
package/build/lib/app-utils.d.ts
CHANGED
|
@@ -1,44 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {string} app
|
|
4
|
-
* @returns {Promise<string>}
|
|
5
|
-
*/
|
|
6
|
-
export function extractBundleId(app: string): Promise<string>;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {string} app
|
|
10
|
-
* @returns {Promise<string>}
|
|
11
|
-
*/
|
|
12
|
-
export function extractBundleVersion(app: string): Promise<string>;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {string} app
|
|
16
|
-
* @returns {Promise<string[]>}
|
|
17
|
-
*/
|
|
18
|
-
export function fetchSupportedAppPlatforms(app: string): Promise<string[]>;
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {Object} PlatformOpts
|
|
21
|
-
*
|
|
22
|
-
* @property {boolean} isSimulator - Whether the destination platform is a Simulator
|
|
23
|
-
* @property {boolean} isTvOS - Whether the destination platform is a Simulator
|
|
24
|
-
*/
|
|
25
1
|
/**
|
|
26
2
|
* Verify whether the given application is compatible to the
|
|
27
3
|
* platform where it is going to be installed and tested.
|
|
28
4
|
*
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
5
|
+
* @this {XCUITestDriver}
|
|
6
|
+
* @returns {Promise<void>}
|
|
31
7
|
* @throws {Error} If bundle architecture does not match the expected device architecture.
|
|
32
8
|
*/
|
|
33
|
-
export function verifyApplicationPlatform(
|
|
34
|
-
|
|
9
|
+
export function verifyApplicationPlatform(this: import("./driver").XCUITestDriver): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {Object} LocalizableStringsOptions
|
|
12
|
+
* @property {string} [app]
|
|
13
|
+
* @property {string} [language='en']
|
|
14
|
+
* @property {string} [localizableStringsDir]
|
|
15
|
+
* @property {string} [stringFile]
|
|
16
|
+
* @property {boolean} [strictMode]
|
|
17
|
+
*/
|
|
35
18
|
/**
|
|
36
|
-
*
|
|
19
|
+
* Extracts string resources from an app
|
|
37
20
|
*
|
|
38
|
-
* @
|
|
39
|
-
* @
|
|
21
|
+
* @this {XCUITestDriver}
|
|
22
|
+
* @param {LocalizableStringsOptions} opts
|
|
23
|
+
* @returns {Promise<import('@appium/types').StringRecord>}
|
|
40
24
|
*/
|
|
41
|
-
export function
|
|
25
|
+
export function parseLocalizableStrings(this: import("./driver").XCUITestDriver, opts?: LocalizableStringsOptions): Promise<import('@appium/types').StringRecord>;
|
|
42
26
|
/**
|
|
43
27
|
* @typedef {Object} UnzipInfo
|
|
44
28
|
* @property {string} rootDir
|
|
@@ -61,14 +45,6 @@ export function unzipFile(archivePath: string): Promise<UnzipInfo>;
|
|
|
61
45
|
* @returns {Promise<UnzipInfo>}
|
|
62
46
|
*/
|
|
63
47
|
export function unzipStream(zipStream: import('node:stream').Readable): Promise<UnzipInfo>;
|
|
64
|
-
/**
|
|
65
|
-
* Moves the application bundle to a newly created temporary folder
|
|
66
|
-
*
|
|
67
|
-
* @param {string} appRoot Full path to the .app bundle
|
|
68
|
-
* @returns {Promise<string>} The new path to the app bundle.
|
|
69
|
-
* The name of the app bundle remains though
|
|
70
|
-
*/
|
|
71
|
-
export function isolateAppBundle(appRoot: string): Promise<string>;
|
|
72
48
|
/**
|
|
73
49
|
* Builds Safari preferences object based on the given session capabilities
|
|
74
50
|
*
|
|
@@ -77,13 +53,19 @@ export function isolateAppBundle(appRoot: string): Promise<string>;
|
|
|
77
53
|
*/
|
|
78
54
|
export function buildSafariPreferences(opts: import('./driver').XCUITestDriverOpts): Promise<import('@appium/types').StringRecord>;
|
|
79
55
|
/**
|
|
80
|
-
*
|
|
56
|
+
* The callback invoked by configureApp helper
|
|
57
|
+
* when it is necessary to download the remote application.
|
|
58
|
+
* We assume the remote file could be anythingm, but only
|
|
59
|
+
* .zip and .ipa formats are supported.
|
|
60
|
+
* A .zip archive can contain one or more
|
|
61
|
+
*
|
|
62
|
+
* @this {XCUITestDriver}
|
|
81
63
|
* @param {import('@appium/types').DownloadAppOptions} opts
|
|
82
64
|
* @returns {Promise<string>}
|
|
83
65
|
*/
|
|
84
|
-
export function onDownloadApp(this: import("./driver").XCUITestDriver, { stream }: import('@appium/types').DownloadAppOptions): Promise<string>;
|
|
66
|
+
export function onDownloadApp(this: import("./driver").XCUITestDriver, { stream, headers }: import('@appium/types').DownloadAppOptions): Promise<string>;
|
|
85
67
|
/**
|
|
86
|
-
* @this {
|
|
68
|
+
* @this {XCUITestDriver}
|
|
87
69
|
* @param {import('@appium/types').PostProcessOptions} opts
|
|
88
70
|
* @returns {Promise<import('@appium/types').PostProcessResult|false>}
|
|
89
71
|
*/
|
|
@@ -92,18 +74,16 @@ export const SAFARI_BUNDLE_ID: "com.apple.mobilesafari";
|
|
|
92
74
|
export const APP_EXT: ".app";
|
|
93
75
|
export const IPA_EXT: ".ipa";
|
|
94
76
|
export const SUPPORTED_EXTENSIONS: string[];
|
|
95
|
-
export type
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
* - Whether the destination platform is a Simulator
|
|
102
|
-
*/
|
|
103
|
-
isTvOS: boolean;
|
|
77
|
+
export type LocalizableStringsOptions = {
|
|
78
|
+
app?: string | undefined;
|
|
79
|
+
language?: string | undefined;
|
|
80
|
+
localizableStringsDir?: string | undefined;
|
|
81
|
+
stringFile?: string | undefined;
|
|
82
|
+
strictMode?: boolean | undefined;
|
|
104
83
|
};
|
|
105
84
|
export type UnzipInfo = {
|
|
106
85
|
rootDir: string;
|
|
107
86
|
archiveSize: number;
|
|
108
87
|
};
|
|
88
|
+
export type XCUITestDriver = import('./driver').XCUITestDriver;
|
|
109
89
|
//# sourceMappingURL=app-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-utils.d.ts","sourceRoot":"","sources":["../../lib/app-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-utils.d.ts","sourceRoot":"","sources":["../../lib/app-utils.js"],"names":[],"mappings":"AA8BA;;;;;;;GAOG;AACH,oFAHa,QAAQ,IAAI,CAAC,CA4CzB;AAgBD;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,wFAHW,yBAAyB,GACvB,QAAQ,OAAO,eAAe,EAAE,YAAY,CAAC,CA6FzD;AA0BD;;;;GAIG;AAEH;;;;;GAKG;AACH,uCAHW,MAAM,GACJ,QAAQ,SAAS,CAAC,CAiB9B;AAED;;;;;;;;GAQG;AACH,uCAHW,OAAO,aAAa,EAAE,QAAQ,GAC5B,QAAQ,SAAS,CAAC,CAoD9B;AAoJD;;;;;GAKG;AACH,6CAHW,OAAO,UAAU,EAAE,kBAAkB,GACpC,QAAQ,OAAO,eAAe,EAAE,YAAY,CAAC,CAexD;AAyGD;;;;;;;;;;GAUG;AACH,4FAHW,OAAO,eAAe,EAAE,kBAAkB,GACxC,QAAQ,MAAM,CAAC,CAM3B;AAED;;;;GAIG;AACH,+GAHW,OAAO,eAAe,EAAE,kBAAkB,GACxC,QAAQ,OAAO,eAAe,EAAE,iBAAiB,GAAC,KAAK,CAAC,CA0DpE;AA7oBD,wDAAyD;AACzD,6BAA8B;AAC9B,6BAA8B;AAW9B,4CAAuD;;;;;;;;;aA4MzC,MAAM;iBACN,MAAM;;6BAsbP,OAAO,UAAU,EAAE,cAAc"}
|