appium-xcuitest-driver 10.8.4 → 10.9.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 +12 -0
- package/build/lib/app-utils.d.ts +2 -2
- package/build/lib/app-utils.d.ts.map +1 -1
- package/build/lib/app-utils.js +4 -1
- package/build/lib/app-utils.js.map +1 -1
- package/build/lib/commands/app-management.js +1 -1
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.js +2 -2
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/biometric.js +3 -3
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +9 -3
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/context.d.ts +5 -5
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +6 -6
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/file-movement.js +3 -3
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/general.js +1 -1
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/gesture.js +1 -1
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/keychains.js +1 -1
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.js +1 -1
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.js +1 -1
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/log.js +7 -7
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/notifications.js +1 -1
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.js +2 -2
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.js +1 -1
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/permissions.js +2 -2
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +0 -3
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/screenshots.js +1 -1
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +1 -1
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +1 -1
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/web.js +1 -1
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +1 -1
- package/build/lib/commands/xctest-record-screen.js.map +1 -1
- package/build/lib/desired-caps.d.ts +383 -507
- package/build/lib/desired-caps.d.ts.map +1 -1
- package/build/lib/desired-caps.js +6 -10
- package/build/lib/desired-caps.js.map +1 -1
- package/build/lib/device/clients/base-device-client.d.ts.map +1 -0
- package/build/lib/device/clients/base-device-client.js.map +1 -0
- package/build/lib/{real-device-clients → device/clients}/py-ios-device-client.d.ts +1 -1
- package/build/lib/device/clients/py-ios-device-client.d.ts.map +1 -0
- package/build/lib/device/clients/py-ios-device-client.js.map +1 -0
- package/build/lib/{device-log → device/log}/helpers.d.ts +1 -1
- package/build/lib/device/log/helpers.d.ts.map +1 -0
- package/build/lib/device/log/helpers.js.map +1 -0
- package/build/lib/{device-log → device/log}/ios-crash-log.d.ts +1 -1
- package/build/lib/device/log/ios-crash-log.d.ts.map +1 -0
- package/build/lib/{device-log → device/log}/ios-crash-log.js +1 -1
- package/build/lib/device/log/ios-crash-log.js.map +1 -0
- package/build/lib/device/log/ios-device-log.d.ts.map +1 -0
- package/build/lib/device/log/ios-device-log.js.map +1 -0
- package/build/lib/{device-log → device/log}/ios-log.d.ts +1 -1
- package/build/lib/device/log/ios-log.d.ts.map +1 -0
- package/build/lib/device/log/ios-log.js.map +1 -0
- package/build/lib/device/log/ios-performance-log.d.ts.map +1 -0
- package/build/lib/device/log/ios-performance-log.js.map +1 -0
- package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -0
- package/build/lib/device/log/ios-simulator-log.js.map +1 -0
- package/build/lib/{device-log → device/log}/line-consuming-log.d.ts +1 -1
- package/build/lib/device/log/line-consuming-log.d.ts.map +1 -0
- package/build/lib/device/log/line-consuming-log.js.map +1 -0
- package/build/lib/{device-log → device/log}/safari-console-log.d.ts +1 -1
- package/build/lib/device/log/safari-console-log.d.ts.map +1 -0
- package/build/lib/device/log/safari-console-log.js.map +1 -0
- package/build/lib/device/log/safari-network-log.d.ts.map +1 -0
- package/build/lib/device/log/safari-network-log.js.map +1 -0
- package/build/lib/device/real-device-management.d.ts.map +1 -1
- package/build/lib/device/real-device-management.js +3 -2
- package/build/lib/device/real-device-management.js.map +1 -1
- package/build/lib/device/simulator-management.js +1 -1
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/driver.d.ts +129 -1385
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +471 -594
- package/build/lib/driver.js.map +1 -1
- package/build/lib/method-map.d.ts +1 -1
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +2 -2
- package/build/lib/method-map.js.map +1 -1
- package/lib/app-utils.js +5 -1
- package/lib/commands/app-management.js +1 -1
- package/lib/commands/appearance.js +2 -2
- package/lib/commands/biometric.js +3 -3
- package/lib/commands/certificate.js +9 -3
- package/lib/commands/context.js +6 -6
- package/lib/commands/file-movement.js +3 -3
- package/lib/commands/general.js +1 -1
- package/lib/commands/gesture.js +1 -1
- package/lib/commands/keychains.js +1 -1
- package/lib/commands/localization.js +1 -1
- package/lib/commands/location.js +1 -1
- package/lib/commands/log.js +7 -7
- package/lib/commands/notifications.js +1 -1
- package/lib/commands/pasteboard.js +2 -2
- package/lib/commands/pcap.js +1 -1
- package/lib/commands/permissions.js +2 -2
- package/lib/commands/proxy-helper.js +0 -3
- package/lib/commands/screenshots.js +1 -1
- package/lib/commands/simctl.js +1 -1
- package/lib/commands/web.js +1 -1
- package/lib/commands/xctest-record-screen.js +1 -1
- package/lib/{desired-caps.js → desired-caps.ts} +7 -6
- package/lib/{real-device-clients → device/clients}/py-ios-device-client.ts +1 -1
- package/lib/{device-log → device/log}/helpers.ts +1 -1
- package/lib/{device-log → device/log}/ios-crash-log.ts +3 -3
- package/lib/{device-log → device/log}/ios-log.ts +1 -1
- package/lib/{device-log → device/log}/line-consuming-log.ts +1 -1
- package/lib/{device-log → device/log}/safari-console-log.ts +1 -1
- package/lib/device/real-device-management.ts +3 -2
- package/lib/device/simulator-management.ts +1 -1
- package/lib/{driver.js → driver.ts} +616 -708
- package/lib/{method-map.js → method-map.ts} +5 -2
- package/npm-shrinkwrap.json +285 -449
- package/package.json +1 -2
- package/build/lib/device-log/helpers.d.ts.map +0 -1
- package/build/lib/device-log/helpers.js.map +0 -1
- package/build/lib/device-log/ios-crash-log.d.ts.map +0 -1
- package/build/lib/device-log/ios-crash-log.js.map +0 -1
- package/build/lib/device-log/ios-device-log.d.ts.map +0 -1
- package/build/lib/device-log/ios-device-log.js.map +0 -1
- package/build/lib/device-log/ios-log.d.ts.map +0 -1
- package/build/lib/device-log/ios-log.js.map +0 -1
- package/build/lib/device-log/ios-performance-log.d.ts.map +0 -1
- package/build/lib/device-log/ios-performance-log.js.map +0 -1
- package/build/lib/device-log/ios-simulator-log.d.ts.map +0 -1
- package/build/lib/device-log/ios-simulator-log.js.map +0 -1
- package/build/lib/device-log/line-consuming-log.d.ts.map +0 -1
- package/build/lib/device-log/line-consuming-log.js.map +0 -1
- package/build/lib/device-log/safari-console-log.d.ts.map +0 -1
- package/build/lib/device-log/safari-console-log.js.map +0 -1
- package/build/lib/device-log/safari-network-log.d.ts.map +0 -1
- package/build/lib/device-log/safari-network-log.js.map +0 -1
- package/build/lib/real-device-clients/base-device-client.d.ts.map +0 -1
- package/build/lib/real-device-clients/base-device-client.js.map +0 -1
- package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +0 -1
- package/build/lib/real-device-clients/py-ios-device-client.js.map +0 -1
- /package/build/lib/{real-device-clients → device/clients}/base-device-client.d.ts +0 -0
- /package/build/lib/{real-device-clients → device/clients}/base-device-client.js +0 -0
- /package/build/lib/{real-device-clients → device/clients}/py-ios-device-client.js +0 -0
- /package/build/lib/{device-log → device/log}/helpers.js +0 -0
- /package/build/lib/{device-log → device/log}/ios-device-log.d.ts +0 -0
- /package/build/lib/{device-log → device/log}/ios-device-log.js +0 -0
- /package/build/lib/{device-log → device/log}/ios-log.js +0 -0
- /package/build/lib/{device-log → device/log}/ios-performance-log.d.ts +0 -0
- /package/build/lib/{device-log → device/log}/ios-performance-log.js +0 -0
- /package/build/lib/{device-log → device/log}/ios-simulator-log.d.ts +0 -0
- /package/build/lib/{device-log → device/log}/ios-simulator-log.js +0 -0
- /package/build/lib/{device-log → device/log}/line-consuming-log.js +0 -0
- /package/build/lib/{device-log → device/log}/safari-console-log.js +0 -0
- /package/build/lib/{device-log → device/log}/safari-network-log.d.ts +0 -0
- /package/build/lib/{device-log → device/log}/safari-network-log.js +0 -0
- /package/lib/{real-device-clients → device/clients}/base-device-client.ts +0 -0
- /package/lib/{device-log → device/log}/ios-device-log.ts +0 -0
- /package/lib/{device-log → device/log}/ios-performance-log.ts +0 -0
- /package/lib/{device-log → device/log}/ios-simulator-log.ts +0 -0
- /package/lib/{device-log → device/log}/safari-network-log.ts +0 -0
|
@@ -16,7 +16,7 @@ export async function mobileSetPasteboard(content, encoding = 'utf8') {
|
|
|
16
16
|
// can be empty string
|
|
17
17
|
throw new Error('Pasteboard content is mandatory to set');
|
|
18
18
|
}
|
|
19
|
-
return await /** @type {import('
|
|
19
|
+
return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.setPasteboard(
|
|
20
20
|
content, /** @type {BufferEncoding} */ (encoding)
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -34,7 +34,7 @@ export async function mobileGetPasteboard(encoding = 'utf8') {
|
|
|
34
34
|
if (!this.isSimulator()) {
|
|
35
35
|
throw new Error('Getting pasteboard content is not supported on real devices');
|
|
36
36
|
}
|
|
37
|
-
return await /** @type {import('
|
|
37
|
+
return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.getPasteboard(encoding);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
package/lib/commands/pcap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pyidevice } from '../
|
|
1
|
+
import { Pyidevice } from '../device/clients/py-ios-device-client';
|
|
2
2
|
import {fs, tempDir, util} from 'appium/support';
|
|
3
3
|
import {encodeBase64OrUpload} from '../utils';
|
|
4
4
|
import {errors} from 'appium/driver';
|
|
@@ -55,7 +55,7 @@ export async function mobileGetPermission(bundleId, service) {
|
|
|
55
55
|
assertSimulator(this);
|
|
56
56
|
|
|
57
57
|
return /** @type {import('./types').PermissionState} */ (
|
|
58
|
-
await /** @type {import('
|
|
58
|
+
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).getPermission(
|
|
59
59
|
bundleId, String(service)
|
|
60
60
|
)
|
|
61
61
|
);
|
|
@@ -77,7 +77,7 @@ export async function mobileSetPermissions(access, bundleId) {
|
|
|
77
77
|
}
|
|
78
78
|
assertSimulator(this);
|
|
79
79
|
|
|
80
|
-
await /** @type {import('
|
|
80
|
+
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).setPermissions(bundleId, access);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
@@ -69,9 +69,6 @@ export async function proxyCommand(url, method, body, isSessionCommand = true) {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if (!this.wda) {
|
|
73
|
-
throw new Error('Cannot call proxyCommand without WDA driver active');
|
|
74
|
-
}
|
|
75
72
|
const proxy = isSessionCommand ? this.wda.jwproxy : this.wda.noSessionProxy;
|
|
76
73
|
if (!proxy) {
|
|
77
74
|
throw new Error('Cannot call proxyCommand without WDA proxy active');
|
|
@@ -60,7 +60,7 @@ export async function getScreenshot() {
|
|
|
60
60
|
// simulator attempt
|
|
61
61
|
if (this.isSimulator()) {
|
|
62
62
|
this.log.info(`Falling back to 'simctl io screenshot' API`);
|
|
63
|
-
const payload = await /** @type {import('
|
|
63
|
+
const payload = await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.getScreenshot();
|
|
64
64
|
if (!payload) {
|
|
65
65
|
throw new errors.UnableToCaptureScreen();
|
|
66
66
|
}
|
package/lib/commands/simctl.js
CHANGED
|
@@ -53,7 +53,7 @@ export async function mobileSimctl(command, args = [], timeout = undefined) {
|
|
|
53
53
|
`Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return await /** @type {import('
|
|
56
|
+
return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.exec(
|
|
57
57
|
command,
|
|
58
58
|
{args: [this.opts.udid, ...args], timeout}
|
|
59
59
|
);
|
package/lib/commands/web.js
CHANGED
|
@@ -960,7 +960,7 @@ export async function mobileUpdateSafariPreferences(preferences) {
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
this.log.debug(`About to update Safari preferences: ${JSON.stringify(preferences)}`);
|
|
963
|
-
await /** @type {import('
|
|
963
|
+
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).updateSafariSettings(preferences);
|
|
964
964
|
}
|
|
965
965
|
|
|
966
966
|
/**
|
|
@@ -32,7 +32,7 @@ const SUBDIRECTORY = 'Attachments';
|
|
|
32
32
|
* @returns {Promise<string>} The full path to the screen recording movie
|
|
33
33
|
*/
|
|
34
34
|
async function retrieveRecodingFromSimulator(uuid) {
|
|
35
|
-
const device = /** @type {import('
|
|
35
|
+
const device = /** @type {import('appium-ios-simulator').Simulator} */ (this.device);
|
|
36
36
|
const dataRoot = /** @type {string} */ (device.getDir());
|
|
37
37
|
// On Simulators the path looks like
|
|
38
38
|
// $HOME/Library/Developer/CoreSimulator/Devices/F8E1968A-8443-4A9A-AB86-27C54C36A2F6/data/Containers/Data/InternalDaemon/4E3FE8DF-AD0A-41DA-B6EC-C35E5798C219/Attachments/A044DAF7-4A58-4CD5-95C3-29B4FE80C377
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type {Constraints} from '@appium/types';
|
|
2
|
+
|
|
1
3
|
// These platform names should be valid in simulator name
|
|
2
|
-
const PLATFORM_NAME_IOS = 'iOS';
|
|
3
|
-
const PLATFORM_NAME_TVOS = 'tvOS';
|
|
4
|
+
export const PLATFORM_NAME_IOS = 'iOS';
|
|
5
|
+
export const PLATFORM_NAME_TVOS = 'tvOS';
|
|
4
6
|
|
|
5
|
-
const desiredCapConstraints =
|
|
7
|
+
export const desiredCapConstraints = {
|
|
6
8
|
platformName: {
|
|
7
9
|
// override
|
|
8
10
|
presence: true,
|
|
@@ -391,7 +393,6 @@ const desiredCapConstraints = /** @type {const} */ ({
|
|
|
391
393
|
isString: true,
|
|
392
394
|
inclusionCaseInsensitive: ['none', 'eager', 'normal']
|
|
393
395
|
}
|
|
394
|
-
}
|
|
396
|
+
} as const satisfies Constraints;
|
|
395
397
|
|
|
396
|
-
export
|
|
397
|
-
export default desiredCapConstraints;
|
|
398
|
+
export type XCUITestDriverConstraints = typeof desiredCapConstraints;
|
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import { BaseDeviceClient } from './base-device-client';
|
|
5
5
|
import type { BaseDeviceClientOptions, InstallProfileArgs } from './base-device-client';
|
|
6
6
|
import type { TeenProcessExecResult } from 'teen_process';
|
|
7
|
-
import type { CertificateList } from '
|
|
7
|
+
import type { CertificateList } from '../../commands/types';
|
|
8
8
|
|
|
9
9
|
// https://github.com/YueChen-C/py-ios-device
|
|
10
10
|
|
|
@@ -2,13 +2,13 @@ import {fs, tempDir, util} from 'appium/support';
|
|
|
2
2
|
import B from 'bluebird';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
-
import {Pyidevice} from '../
|
|
5
|
+
import {Pyidevice} from '../clients/py-ios-device-client';
|
|
6
6
|
import {IOSLog} from './ios-log';
|
|
7
7
|
import { toLogEntry, grepFile } from './helpers';
|
|
8
8
|
import type { AppiumLogger } from '@appium/types';
|
|
9
|
-
import type { BaseDeviceClient } from '../
|
|
9
|
+
import type { BaseDeviceClient } from '../clients/base-device-client';
|
|
10
10
|
import type { Simulator } from 'appium-ios-simulator';
|
|
11
|
-
import type { LogEntry } from '
|
|
11
|
+
import type { LogEntry } from '../../commands/types';
|
|
12
12
|
|
|
13
13
|
// The file format has been changed from '.crash' to '.ips' since Monterey.
|
|
14
14
|
const CRASH_REPORTS_GLOB_PATTERN = '**/*.@(crash|ips)';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {EventEmitter} from 'events';
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
|
-
import type { LogEntry } from '
|
|
3
|
+
import type { LogEntry } from '../../commands/types';
|
|
4
4
|
import type { AppiumLogger } from '@appium/types';
|
|
5
5
|
import {logger} from 'appium/support';
|
|
6
6
|
|
|
@@ -709,8 +709,9 @@ export function applySafariStartupArgs(this: XCUITestDriver): boolean {
|
|
|
709
709
|
const args = _.toPairs(prefs)
|
|
710
710
|
.flatMap(([key, value]) => [_.startsWith(key, '-') ? key : `-${key}`, String(value)]);
|
|
711
711
|
defaultLogger.debug(`Generated Safari command line arguments: ${args.join(' ')}`);
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
const processArguments = this.opts.processArguments as {args: string[]} | undefined;
|
|
713
|
+
if (processArguments && _.isPlainObject(processArguments)) {
|
|
714
|
+
processArguments.args = [...(processArguments.args ?? []), ...args];
|
|
714
715
|
} else {
|
|
715
716
|
this.opts.processArguments = {args};
|
|
716
717
|
}
|
|
@@ -157,7 +157,7 @@ export async function runSimulatorReset(
|
|
|
157
157
|
const isKeychainsBackupSuccessful = (keychainsExcludePatterns || keepKeyChains) && (await device.backupKeychains());
|
|
158
158
|
await device.clean();
|
|
159
159
|
if (isKeychainsBackupSuccessful) {
|
|
160
|
-
await device.restoreKeychains(keychainsExcludePatterns || []);
|
|
160
|
+
await device.restoreKeychains(keychainsExcludePatterns?.split(',')?.map(_.trim) || []);
|
|
161
161
|
this.log.info(`Successfully restored keychains after full reset`);
|
|
162
162
|
} else if (keychainsExcludePatterns || keepKeyChains) {
|
|
163
163
|
this.log.warn(
|