appium-xcuitest-driver 10.10.1 → 10.11.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 +6 -0
- package/build/lib/app-infos-cache.d.ts +29 -31
- package/build/lib/app-infos-cache.d.ts.map +1 -1
- package/build/lib/app-infos-cache.js +29 -33
- package/build/lib/app-infos-cache.js.map +1 -1
- package/build/lib/app-utils.d.ts +30 -59
- package/build/lib/app-utils.d.ts.map +1 -1
- package/build/lib/app-utils.js +158 -211
- package/build/lib/app-utils.js.map +1 -1
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +4 -8
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +1 -5
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/condition.js +4 -4
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/content-size.js +1 -1
- package/build/lib/commands/content-size.js.map +1 -1
- package/build/lib/commands/find.js +2 -2
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/increase-contrast.js +1 -1
- package/build/lib/commands/increase-contrast.js.map +1 -1
- package/build/lib/commands/keychains.d.ts.map +1 -1
- package/build/lib/commands/keychains.js +1 -5
- 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 -5
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +10 -8
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/permissions.js +1 -1
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/css-converter.d.ts +3 -9
- package/build/lib/css-converter.d.ts.map +1 -1
- package/build/lib/css-converter.js +41 -52
- package/build/lib/css-converter.js.map +1 -1
- package/build/lib/device/real-device-management.js +14 -14
- package/build/lib/device/real-device-management.js.map +1 -1
- package/build/lib/device/simulator-management.d.ts.map +1 -1
- package/build/lib/device/simulator-management.js +8 -4
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +3 -3
- package/build/lib/driver.js.map +1 -1
- package/build/lib/logger.d.ts +1 -2
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +2 -2
- package/build/lib/logger.js.map +1 -1
- package/build/lib/utils.d.ts +76 -134
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +80 -141
- package/build/lib/utils.js.map +1 -1
- package/lib/{app-infos-cache.js → app-infos-cache.ts} +44 -46
- package/lib/{app-utils.js → app-utils.ts} +215 -245
- package/lib/commands/battery.js +3 -4
- package/lib/commands/biometric.js +1 -2
- package/lib/commands/condition.js +1 -1
- package/lib/commands/content-size.js +1 -1
- package/lib/commands/find.js +1 -1
- package/lib/commands/increase-contrast.js +1 -1
- package/lib/commands/keychains.js +1 -2
- package/lib/commands/localization.js +1 -2
- package/lib/commands/pasteboard.js +9 -8
- package/lib/commands/permissions.js +1 -1
- package/lib/{css-converter.js → css-converter.ts} +75 -88
- package/lib/device/real-device-management.ts +1 -1
- package/lib/device/simulator-management.ts +9 -4
- package/lib/driver.ts +6 -4
- package/lib/logger.ts +3 -0
- package/lib/{utils.js → utils.ts} +102 -139
- package/npm-shrinkwrap.json +26 -30
- package/package.json +2 -2
- package/lib/logger.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [10.11.0](https://github.com/appium/appium-xcuitest-driver/compare/v10.10.1...v10.11.0) (2025-12-13)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* Migrate various modules to typescript ([#2672](https://github.com/appium/appium-xcuitest-driver/issues/2672)) ([b8c86a9](https://github.com/appium/appium-xcuitest-driver/commit/b8c86a969419326d48f37510b0e7c4819b9fe851))
|
|
6
|
+
|
|
1
7
|
## [10.10.1](https://github.com/appium/appium-xcuitest-driver/compare/v10.10.0...v10.10.1) (2025-12-11)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,62 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(log: import("@appium/types").AppiumLogger);
|
|
6
|
-
log: import("@appium/types").AppiumLogger;
|
|
1
|
+
import type { AppiumLogger, StringRecord } from '@appium/types';
|
|
2
|
+
export declare class AppInfosCache {
|
|
3
|
+
private readonly log;
|
|
4
|
+
constructor(log: AppiumLogger);
|
|
7
5
|
/**
|
|
8
6
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
7
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
8
|
+
* @param propertyName
|
|
9
|
+
* @returns
|
|
12
10
|
*/
|
|
13
11
|
extractManifestProperty(bundlePath: string, propertyName: string): Promise<any>;
|
|
14
12
|
/**
|
|
15
13
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
14
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
15
|
+
* @returns
|
|
18
16
|
*/
|
|
19
17
|
extractBundleId(bundlePath: string): Promise<string>;
|
|
20
18
|
/**
|
|
21
19
|
*
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
20
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
21
|
+
* @returns
|
|
24
22
|
*/
|
|
25
23
|
extractBundleVersion(bundlePath: string): Promise<string>;
|
|
26
24
|
/**
|
|
27
25
|
*
|
|
28
|
-
* @param
|
|
29
|
-
* @returns
|
|
26
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
27
|
+
* @returns
|
|
30
28
|
*/
|
|
31
29
|
extractAppPlatforms(bundlePath: string): Promise<string[]>;
|
|
32
30
|
/**
|
|
33
31
|
*
|
|
34
|
-
* @param
|
|
35
|
-
* @returns
|
|
32
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
33
|
+
* @returns
|
|
36
34
|
*/
|
|
37
35
|
extractExecutableName(bundlePath: string): Promise<string>;
|
|
38
36
|
/**
|
|
39
37
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @returns
|
|
42
|
-
* @throws
|
|
38
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
39
|
+
* @returns The payload of the manifest plist
|
|
40
|
+
* @throws If the given app is not a valid bundle
|
|
43
41
|
*/
|
|
44
|
-
put(bundlePath: string): Promise<
|
|
42
|
+
put(bundlePath: string): Promise<StringRecord>;
|
|
45
43
|
/**
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
44
|
+
* @param ipaPath Fill path to the .ipa bundle
|
|
45
|
+
* @returns The payload of the manifest plist
|
|
48
46
|
*/
|
|
49
|
-
_putIpa
|
|
47
|
+
private _putIpa;
|
|
50
48
|
/**
|
|
51
|
-
* @param
|
|
52
|
-
* @returns
|
|
49
|
+
* @param appPath Fill path to the .app bundle
|
|
50
|
+
* @returns The payload of the manifest plist
|
|
53
51
|
*/
|
|
54
|
-
_putApp
|
|
52
|
+
private _putApp;
|
|
55
53
|
/**
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @returns
|
|
54
|
+
* @param plistPath Full path to the plist
|
|
55
|
+
* @param bundlePath Full path to .ipa or .app bundle
|
|
56
|
+
* @returns The payload of the plist file
|
|
59
57
|
*/
|
|
60
|
-
_readPlist
|
|
58
|
+
private _readPlist;
|
|
61
59
|
}
|
|
62
60
|
//# sourceMappingURL=app-infos-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-infos-cache.d.ts","sourceRoot":"","sources":["../../lib/app-infos-cache.
|
|
1
|
+
{"version":3,"file":"app-infos-cache.d.ts","sourceRoot":"","sources":["../../lib/app-infos-cache.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAY9D,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;gBAEvB,GAAG,EAAE,YAAY;IAI7B;;;;;OAKG;IACG,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAMrF;;;;OAIG;IACG,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D;;;;OAIG;IACG,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/D;;;;OAIG;IACG,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQhE;;;;OAIG;IACG,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhE;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAMpD;;;OAGG;YACW,OAAO;IAuDrB;;;OAGG;YACW,OAAO;IAoBrB;;;;OAIG;YACW,UAAU;CAQzB"}
|
|
@@ -5,11 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AppInfosCache = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const support_1 = require("appium/support");
|
|
10
10
|
const lru_cache_1 = require("lru-cache");
|
|
11
11
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
12
|
-
/** @type {LRUCache<string, import('@appium/types').StringRecord>} */
|
|
13
12
|
const MANIFEST_CACHE = new lru_cache_1.LRUCache({
|
|
14
13
|
max: 40,
|
|
15
14
|
updateAgeOnHas: true,
|
|
@@ -18,17 +17,15 @@ const MANIFEST_FILE_NAME = 'Info.plist';
|
|
|
18
17
|
const IPA_ROOT_PLIST_PATH_PATTERN = new RegExp(`^Payload/[^/]+\\.app/${lodash_1.default.escapeRegExp(MANIFEST_FILE_NAME)}$`);
|
|
19
18
|
const MAX_MANIFEST_SIZE = 1024 * 1024; // 1 MiB
|
|
20
19
|
class AppInfosCache {
|
|
21
|
-
|
|
22
|
-
* @param {import('@appium/types').AppiumLogger} log
|
|
23
|
-
*/
|
|
20
|
+
log;
|
|
24
21
|
constructor(log) {
|
|
25
22
|
this.log = log;
|
|
26
23
|
}
|
|
27
24
|
/**
|
|
28
25
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @returns
|
|
26
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
27
|
+
* @param propertyName
|
|
28
|
+
* @returns
|
|
32
29
|
*/
|
|
33
30
|
async extractManifestProperty(bundlePath, propertyName) {
|
|
34
31
|
const result = (await this.put(bundlePath))[propertyName];
|
|
@@ -37,45 +34,45 @@ class AppInfosCache {
|
|
|
37
34
|
}
|
|
38
35
|
/**
|
|
39
36
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @returns
|
|
37
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
38
|
+
* @returns
|
|
42
39
|
*/
|
|
43
40
|
async extractBundleId(bundlePath) {
|
|
44
41
|
return await this.extractManifestProperty(bundlePath, 'CFBundleIdentifier');
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
44
|
*
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
45
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
46
|
+
* @returns
|
|
50
47
|
*/
|
|
51
48
|
async extractBundleVersion(bundlePath) {
|
|
52
49
|
return await this.extractManifestProperty(bundlePath, 'CFBundleVersion');
|
|
53
50
|
}
|
|
54
51
|
/**
|
|
55
52
|
*
|
|
56
|
-
* @param
|
|
57
|
-
* @returns
|
|
53
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
54
|
+
* @returns
|
|
58
55
|
*/
|
|
59
56
|
async extractAppPlatforms(bundlePath) {
|
|
60
57
|
const result = await this.extractManifestProperty(bundlePath, 'CFBundleSupportedPlatforms');
|
|
61
58
|
if (!Array.isArray(result)) {
|
|
62
|
-
throw new Error(`${
|
|
59
|
+
throw new Error(`${node_path_1.default.basename(bundlePath)}': CFBundleSupportedPlatforms is not a valid list`);
|
|
63
60
|
}
|
|
64
61
|
return result;
|
|
65
62
|
}
|
|
66
63
|
/**
|
|
67
64
|
*
|
|
68
|
-
* @param
|
|
69
|
-
* @returns
|
|
65
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
66
|
+
* @returns
|
|
70
67
|
*/
|
|
71
68
|
async extractExecutableName(bundlePath) {
|
|
72
69
|
return await this.extractManifestProperty(bundlePath, 'CFBundleExecutable');
|
|
73
70
|
}
|
|
74
71
|
/**
|
|
75
72
|
*
|
|
76
|
-
* @param
|
|
77
|
-
* @returns
|
|
78
|
-
* @throws
|
|
73
|
+
* @param bundlePath Full path to the .ipa or .app bundle
|
|
74
|
+
* @returns The payload of the manifest plist
|
|
75
|
+
* @throws If the given app is not a valid bundle
|
|
79
76
|
*/
|
|
80
77
|
async put(bundlePath) {
|
|
81
78
|
return (await support_1.fs.stat(bundlePath)).isFile()
|
|
@@ -83,13 +80,11 @@ class AppInfosCache {
|
|
|
83
80
|
: await this._putApp(bundlePath);
|
|
84
81
|
}
|
|
85
82
|
/**
|
|
86
|
-
* @param
|
|
87
|
-
* @returns
|
|
83
|
+
* @param ipaPath Fill path to the .ipa bundle
|
|
84
|
+
* @returns The payload of the manifest plist
|
|
88
85
|
*/
|
|
89
86
|
async _putIpa(ipaPath) {
|
|
90
|
-
/** @type {import('@appium/types').StringRecord|undefined} */
|
|
91
87
|
let manifestPayload;
|
|
92
|
-
/** @type {Error|undefined} */
|
|
93
88
|
let lastError;
|
|
94
89
|
try {
|
|
95
90
|
await support_1.zip.readEntries(ipaPath, async ({ entry, extractEntryTo }) => {
|
|
@@ -110,7 +105,7 @@ class AppInfosCache {
|
|
|
110
105
|
const tmpRoot = await support_1.tempDir.openDir();
|
|
111
106
|
try {
|
|
112
107
|
await extractEntryTo(tmpRoot);
|
|
113
|
-
const plistPath =
|
|
108
|
+
const plistPath = node_path_1.default.resolve(tmpRoot, entry.fileName);
|
|
114
109
|
manifestPayload = await this._readPlist(plistPath, ipaPath);
|
|
115
110
|
if (lodash_1.default.isPlainObject(manifestPayload) && entry.uncompressedSize <= MAX_MANIFEST_SIZE) {
|
|
116
111
|
this.log.debug(`Caching the manifest '${entry.fileName}' for ${manifestPayload?.CFBundleIdentifier} app ` +
|
|
@@ -142,14 +137,15 @@ class AppInfosCache {
|
|
|
142
137
|
return manifestPayload;
|
|
143
138
|
}
|
|
144
139
|
/**
|
|
145
|
-
* @param
|
|
146
|
-
* @returns
|
|
140
|
+
* @param appPath Fill path to the .app bundle
|
|
141
|
+
* @returns The payload of the manifest plist
|
|
147
142
|
*/
|
|
148
143
|
async _putApp(appPath) {
|
|
149
|
-
const manifestPath =
|
|
144
|
+
const manifestPath = node_path_1.default.join(appPath, MANIFEST_FILE_NAME);
|
|
150
145
|
const hash = await support_1.fs.hash(manifestPath);
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
const cached = MANIFEST_CACHE.get(hash);
|
|
147
|
+
if (cached) {
|
|
148
|
+
return cached;
|
|
153
149
|
}
|
|
154
150
|
const [payload, stat] = await bluebird_1.default.all([
|
|
155
151
|
this._readPlist(manifestPath, appPath),
|
|
@@ -162,9 +158,9 @@ class AppInfosCache {
|
|
|
162
158
|
return payload;
|
|
163
159
|
}
|
|
164
160
|
/**
|
|
165
|
-
* @param
|
|
166
|
-
* @param
|
|
167
|
-
* @returns
|
|
161
|
+
* @param plistPath Full path to the plist
|
|
162
|
+
* @param bundlePath Full path to .ipa or .app bundle
|
|
163
|
+
* @returns The payload of the plist file
|
|
168
164
|
*/
|
|
169
165
|
async _readPlist(plistPath, bundlePath) {
|
|
170
166
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-infos-cache.js","sourceRoot":"","sources":["../../lib/app-infos-cache.
|
|
1
|
+
{"version":3,"file":"app-infos-cache.js","sourceRoot":"","sources":["../../lib/app-infos-cache.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,0DAA6B;AAC7B,4CAAuD;AACvD,yCAAmC;AACnC,wDAAyB;AAGzB,MAAM,cAAc,GAAG,IAAI,oBAAQ,CAAuB;IACxD,GAAG,EAAE,EAAE;IACP,cAAc,EAAE,IAAI;CACrB,CAAC,CAAC;AACH,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,2BAA2B,GAAG,IAAI,MAAM,CAC5C,wBAAwB,gBAAC,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAC9D,CAAC;AACF,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE/C,MAAa,aAAa;IACP,GAAG,CAAe;IAEnC,YAAY,GAAiB;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAAC,UAAkB,EAAE,YAAoB;QACpE,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAC1D,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,CAAC,UAAkB;QACtC,OAAO,MAAM,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB,CAAC,UAAkB;QAC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AAI,EAAE,OAAO,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,UAAU,CAAC,SAAiB,EAAE,UAAkB;QAC5D,IAAI,CAAC;YACH,OAAO,MAAM,eAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,gBAAgB,kBAAkB,QAAQ,UAAU,sCAAsC,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC;CACF;AAvKD,sCAuKC"}
|
package/build/lib/app-utils.d.ts
CHANGED
|
@@ -1,89 +1,60 @@
|
|
|
1
|
+
import type { XCUITestDriver, XCUITestDriverOpts } from './driver';
|
|
2
|
+
import type { StringRecord, DownloadAppOptions, PostProcessOptions, PostProcessResult } from '@appium/types';
|
|
3
|
+
import type { Readable } from 'node:stream';
|
|
4
|
+
export declare const SAFARI_BUNDLE_ID = "com.apple.mobilesafari";
|
|
5
|
+
export declare const APP_EXT = ".app";
|
|
6
|
+
export declare const IPA_EXT = ".ipa";
|
|
7
|
+
export declare const SUPPORTED_EXTENSIONS: string[];
|
|
8
|
+
export interface LocalizableStringsOptions {
|
|
9
|
+
app?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
localizableStringsDir?: string;
|
|
12
|
+
stringFile?: string;
|
|
13
|
+
strictMode?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UnzipInfo {
|
|
16
|
+
rootDir: string;
|
|
17
|
+
archiveSize: number;
|
|
18
|
+
}
|
|
1
19
|
/**
|
|
2
20
|
* Verify whether the given application is compatible to the
|
|
3
21
|
* platform where it is going to be installed and tested.
|
|
4
22
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @returns {Promise<void>}
|
|
7
|
-
* @throws {Error} If bundle architecture does not match the expected device architecture.
|
|
8
|
-
*/
|
|
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]
|
|
23
|
+
* @throws If bundle architecture does not match the expected device architecture.
|
|
17
24
|
*/
|
|
25
|
+
export declare function verifyApplicationPlatform(this: XCUITestDriver): Promise<void>;
|
|
18
26
|
/**
|
|
19
27
|
* Extracts string resources from an app
|
|
20
|
-
*
|
|
21
|
-
* @this {XCUITestDriver}
|
|
22
|
-
* @param {LocalizableStringsOptions} opts
|
|
23
|
-
* @returns {Promise<import('@appium/types').StringRecord>}
|
|
24
|
-
*/
|
|
25
|
-
export function parseLocalizableStrings(this: import("./driver").XCUITestDriver, opts?: LocalizableStringsOptions): Promise<import("@appium/types").StringRecord>;
|
|
26
|
-
/**
|
|
27
|
-
* @typedef {Object} UnzipInfo
|
|
28
|
-
* @property {string} rootDir
|
|
29
|
-
* @property {number} archiveSize
|
|
30
28
|
*/
|
|
29
|
+
export declare function parseLocalizableStrings(this: XCUITestDriver, opts?: LocalizableStringsOptions): Promise<StringRecord>;
|
|
31
30
|
/**
|
|
32
31
|
* Unzips a ZIP archive on the local file system.
|
|
33
32
|
*
|
|
34
|
-
* @param
|
|
35
|
-
* @returns
|
|
33
|
+
* @param archivePath Full path to a .zip archive
|
|
34
|
+
* @returns temporary folder root where the archive has been extracted
|
|
36
35
|
*/
|
|
37
|
-
export function unzipFile(archivePath: string): Promise<UnzipInfo>;
|
|
36
|
+
export declare function unzipFile(archivePath: string): Promise<UnzipInfo>;
|
|
38
37
|
/**
|
|
39
38
|
* Unzips a ZIP archive from a stream.
|
|
40
39
|
* Uses bdstar tool for this purpose.
|
|
41
40
|
* This allows to optimize the time needed to prepare the app under test
|
|
42
41
|
* to MAX(download, unzip) instead of SUM(download, unzip)
|
|
43
|
-
*
|
|
44
|
-
* @param {import('node:stream').Readable} zipStream
|
|
45
|
-
* @returns {Promise<UnzipInfo>}
|
|
46
42
|
*/
|
|
47
|
-
export function unzipStream(zipStream:
|
|
43
|
+
export declare function unzipStream(zipStream: Readable): Promise<UnzipInfo>;
|
|
48
44
|
/**
|
|
49
45
|
* Builds Safari preferences object based on the given session capabilities
|
|
50
46
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @return
|
|
47
|
+
* @param opts
|
|
48
|
+
* @return
|
|
53
49
|
*/
|
|
54
|
-
export function buildSafariPreferences(opts:
|
|
50
|
+
export declare function buildSafariPreferences(opts: XCUITestDriverOpts): StringRecord;
|
|
55
51
|
/**
|
|
56
52
|
* The callback invoked by configureApp helper
|
|
57
53
|
* when it is necessary to download the remote application.
|
|
58
54
|
* We assume the remote file could be anythingm, but only
|
|
59
55
|
* .zip and .ipa formats are supported.
|
|
60
56
|
* A .zip archive can contain one or more
|
|
61
|
-
*
|
|
62
|
-
* @this {XCUITestDriver}
|
|
63
|
-
* @param {import('@appium/types').DownloadAppOptions} opts
|
|
64
|
-
* @returns {Promise<string>}
|
|
65
|
-
*/
|
|
66
|
-
export function onDownloadApp(this: import("./driver").XCUITestDriver, { stream, headers }: import("@appium/types").DownloadAppOptions): Promise<string>;
|
|
67
|
-
/**
|
|
68
|
-
* @this {XCUITestDriver}
|
|
69
|
-
* @param {import('@appium/types').PostProcessOptions} opts
|
|
70
|
-
* @returns {Promise<import('@appium/types').PostProcessResult|false>}
|
|
71
57
|
*/
|
|
72
|
-
export function
|
|
73
|
-
export
|
|
74
|
-
export const APP_EXT: ".app";
|
|
75
|
-
export const IPA_EXT: ".ipa";
|
|
76
|
-
export const SUPPORTED_EXTENSIONS: string[];
|
|
77
|
-
export type LocalizableStringsOptions = {
|
|
78
|
-
app?: string | undefined;
|
|
79
|
-
language?: string | undefined;
|
|
80
|
-
localizableStringsDir?: string | undefined;
|
|
81
|
-
stringFile?: string | undefined;
|
|
82
|
-
strictMode?: boolean | undefined;
|
|
83
|
-
};
|
|
84
|
-
export type UnzipInfo = {
|
|
85
|
-
rootDir: string;
|
|
86
|
-
archiveSize: number;
|
|
87
|
-
};
|
|
88
|
-
export type XCUITestDriver = import("./driver").XCUITestDriver;
|
|
58
|
+
export declare function onDownloadApp(this: XCUITestDriver, opts: DownloadAppOptions): Promise<string>;
|
|
59
|
+
export declare function onPostConfigureApp(this: XCUITestDriver, opts: PostProcessOptions): Promise<PostProcessResult | false>;
|
|
89
60
|
//# sourceMappingURL=app-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-utils.d.ts","sourceRoot":"","sources":["../../lib/app-utils.
|
|
1
|
+
{"version":3,"file":"app-utils.d.ts","sourceRoot":"","sources":["../../lib/app-utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAC,YAAY,EAAe,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,eAAe,CAAC;AACvI,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AACzD,eAAO,MAAM,OAAO,SAAS,CAAC;AAC9B,eAAO,MAAM,OAAO,SAAS,CAAC;AAC9B,eAAO,MAAM,oBAAoB,UAAqB,CAAC;AAiBvD,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC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