@limrun/appium-xcuitest-driver 10.11.0-lim.4 → 10.14.6-lim.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 +94 -0
- package/build/lib/commands/active-app-info.d.ts +4 -3
- package/build/lib/commands/active-app-info.d.ts.map +1 -1
- package/build/lib/commands/active-app-info.js +2 -3
- package/build/lib/commands/active-app-info.js.map +1 -1
- package/build/lib/commands/alert.d.ts +26 -31
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +20 -29
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +99 -76
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +83 -73
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +6 -7
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +3 -8
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +7 -9
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +13 -19
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/audit.d.ts +5 -33
- package/build/lib/commands/audit.d.ts.map +1 -1
- package/build/lib/commands/audit.js +3 -16
- package/build/lib/commands/audit.js.map +1 -1
- package/build/lib/commands/battery.d.ts +4 -4
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +3 -7
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/biometric.d.ts +12 -14
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +10 -19
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts +14 -19
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +24 -31
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +9 -11
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +8 -13
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/condition.d.ts +9 -72
- package/build/lib/commands/condition.d.ts.map +1 -1
- package/build/lib/commands/condition.js +5 -66
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/content-size.d.ts +16 -19
- package/build/lib/commands/content-size.d.ts.map +1 -1
- package/build/lib/commands/content-size.js +14 -22
- package/build/lib/commands/content-size.js.map +1 -1
- package/build/lib/commands/context.d.ts +130 -161
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +123 -108
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/device-info.d.ts +13 -0
- package/build/lib/commands/device-info.d.ts.map +1 -0
- package/build/lib/commands/device-info.js +20 -0
- package/build/lib/commands/device-info.js.map +1 -0
- package/build/lib/commands/element.d.ts +83 -67
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +111 -134
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +10 -22
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +13 -29
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-movement.d.ts +31 -42
- package/build/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +146 -205
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/find.d.ts +20 -12
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +27 -65
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +84 -80
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +67 -54
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +16 -36
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +8 -25
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/gesture.d.ts +103 -119
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +98 -138
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/increase-contrast.d.ts +10 -13
- package/build/lib/commands/increase-contrast.d.ts.map +1 -1
- package/build/lib/commands/increase-contrast.js +8 -16
- package/build/lib/commands/increase-contrast.js.map +1 -1
- package/build/lib/commands/iohid.d.ts +6 -1359
- package/build/lib/commands/iohid.d.ts.map +1 -1
- package/build/lib/commands/iohid.js +5 -10
- package/build/lib/commands/iohid.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +16 -13
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +14 -18
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/keychains.d.ts +2 -2
- package/build/lib/commands/keychains.d.ts.map +1 -1
- package/build/lib/commands/keychains.js +1 -4
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.d.ts +7 -6
- package/build/lib/commands/localization.d.ts.map +1 -1
- package/build/lib/commands/localization.js +7 -8
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.d.ts +8 -11
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +7 -15
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/lock.d.ts +6 -10
- package/build/lib/commands/lock.d.ts.map +1 -1
- package/build/lib/commands/lock.js +3 -10
- package/build/lib/commands/lock.js.map +1 -1
- package/build/lib/commands/log.d.ts +42 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +32 -53
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/memory.d.ts +4 -5
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +3 -8
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +14 -26
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +22 -32
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +10 -10
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +8 -12
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts +9 -10
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +8 -13
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +18 -38
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +9 -14
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/performance.d.ts +36 -55
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +93 -86
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +15 -17
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +12 -18
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts +11 -11
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +15 -24
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/record-audio.d.ts +25 -52
- package/build/lib/commands/record-audio.d.ts.map +1 -1
- package/build/lib/commands/record-audio.js +17 -19
- package/build/lib/commands/record-audio.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +31 -62
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +29 -28
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +15 -9
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +16 -16
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +16 -22
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +13 -17
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/source.d.ts +10 -8
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +11 -14
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/commands/timeouts.d.ts +25 -32
- package/build/lib/commands/timeouts.d.ts.map +1 -1
- package/build/lib/commands/timeouts.js +19 -15
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/commands/types.d.ts +80 -0
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/commands/web.d.ts +199 -202
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +216 -175
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts +17 -47
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +28 -59
- package/build/lib/commands/xctest-record-screen.js.map +1 -1
- package/build/lib/commands/xctest.d.ts +37 -37
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +38 -50
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/desired-caps.js +1 -1
- package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
- package/build/lib/device/log/ios-simulator-log.js +2 -0
- package/build/lib/device/log/ios-simulator-log.js.map +1 -1
- package/build/lib/device/simulator-management.d.ts.map +1 -1
- package/build/lib/device/simulator-management.js +0 -2
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +0 -9
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +1 -30
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/driver.d.ts +6 -5
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +16 -14
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +0 -9
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/active-app-info.ts +15 -0
- package/lib/commands/alert.ts +98 -0
- package/lib/commands/app-management.ts +414 -0
- package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
- package/lib/commands/appearance.ts +70 -0
- package/lib/commands/audit.ts +25 -0
- package/lib/commands/{battery.js → battery.ts} +10 -12
- package/lib/commands/biometric.ts +52 -0
- package/lib/commands/{certificate.js → certificate.ts} +55 -50
- package/lib/commands/clipboard.ts +37 -0
- package/lib/commands/{condition.js → condition.ts} +21 -77
- package/lib/commands/content-size.ts +67 -0
- package/lib/commands/{context.js → context.ts} +174 -146
- package/lib/commands/device-info.ts +24 -0
- package/lib/commands/element.ts +419 -0
- package/lib/commands/{execute.js → execute.ts} +42 -38
- package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
- package/lib/commands/find.ts +277 -0
- package/lib/commands/{general.js → general.ts} +102 -77
- package/lib/commands/geolocation.ts +55 -0
- package/lib/commands/{gesture.js → gesture.ts} +225 -183
- package/lib/commands/increase-contrast.ts +49 -0
- package/lib/commands/{iohid.js → iohid.ts} +15 -13
- package/lib/commands/keyboard.ts +70 -0
- package/lib/commands/keychains.ts +16 -0
- package/lib/commands/{localization.js → localization.ts} +22 -12
- package/lib/commands/{location.js → location.ts} +19 -22
- package/lib/commands/lock.ts +43 -0
- package/lib/commands/{log.js → log.ts} +68 -68
- package/lib/commands/{memory.js → memory.ts} +9 -9
- package/lib/commands/{navigation.js → navigation.ts} +42 -39
- package/lib/commands/{notifications.js → notifications.ts} +22 -14
- package/lib/commands/pasteboard.ts +44 -0
- package/lib/commands/{pcap.js → pcap.ts} +28 -28
- package/lib/commands/{performance.js → performance.ts} +133 -114
- package/lib/commands/permissions.ts +90 -0
- package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
- package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
- package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
- package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
- package/lib/commands/simctl.ts +82 -0
- package/lib/commands/{source.js → source.ts} +23 -20
- package/lib/commands/timeouts.ts +95 -0
- package/lib/commands/types.ts +86 -0
- package/lib/commands/{web.js → web.ts} +314 -264
- package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
- package/lib/commands/{xctest.js → xctest.ts} +78 -71
- package/lib/desired-caps.ts +1 -1
- package/lib/device/log/ios-simulator-log.ts +2 -0
- package/lib/device/simulator-management.ts +0 -2
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +19 -17
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -6
- package/lib/commands/active-app-info.js +0 -12
- package/lib/commands/alert.js +0 -88
- package/lib/commands/app-management.js +0 -346
- package/lib/commands/appearance.js +0 -71
- package/lib/commands/audit.js +0 -31
- package/lib/commands/biometric.js +0 -52
- package/lib/commands/clipboard.js +0 -35
- package/lib/commands/content-size.js +0 -68
- package/lib/commands/deviceInfo.js +0 -27
- package/lib/commands/element.js +0 -423
- package/lib/commands/find.js +0 -205
- package/lib/commands/geolocation.js +0 -56
- package/lib/commands/increase-contrast.js +0 -50
- package/lib/commands/keyboard.js +0 -62
- package/lib/commands/keychains.js +0 -17
- package/lib/commands/lock.js +0 -46
- package/lib/commands/pasteboard.js +0 -43
- package/lib/commands/permissions.js +0 -85
- package/lib/commands/simctl.js +0 -71
- package/lib/commands/timeouts.js +0 -68
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import js2xml from 'js2xmlparser2';
|
|
3
|
+
import type {XCUITestDriver} from '../driver';
|
|
4
|
+
import type {SourceFormat} from './types';
|
|
3
5
|
|
|
4
6
|
const APPIUM_AUT_TAG = 'AppiumAUT';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* Retrieves the page source of the current application.
|
|
10
|
+
*
|
|
11
|
+
* @returns The page source as XML or HTML string
|
|
8
12
|
*/
|
|
9
|
-
export async function getPageSource() {
|
|
13
|
+
export async function getPageSource(this: XCUITestDriver): Promise<string> {
|
|
10
14
|
if (this.isWebContext()) {
|
|
11
15
|
const script = 'return document.documentElement.outerHTML';
|
|
12
16
|
return await this.executeAtom('execute_script', [script, []]);
|
|
@@ -28,14 +32,17 @@ export async function getPageSource() {
|
|
|
28
32
|
/**
|
|
29
33
|
* Retrieve the source tree of the current page in XML or JSON format.
|
|
30
34
|
*
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
35
|
+
* @param format - Page tree source representation format.
|
|
36
|
+
* @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
|
|
33
37
|
* @privateRemarks Why isn't `excludedAttributes` an array?
|
|
34
|
-
* @returns
|
|
35
|
-
* @this {XCUITestDriver}
|
|
38
|
+
* @returns The source tree of the current page in the given format.
|
|
36
39
|
*/
|
|
37
|
-
export async function mobileGetSource(
|
|
38
|
-
|
|
40
|
+
export async function mobileGetSource(
|
|
41
|
+
this: XCUITestDriver,
|
|
42
|
+
format: SourceFormat = 'xml',
|
|
43
|
+
excludedAttributes?: string,
|
|
44
|
+
): Promise<string> {
|
|
45
|
+
const paramsMap: Record<string, string> = {
|
|
39
46
|
format,
|
|
40
47
|
scope: APPIUM_AUT_TAG,
|
|
41
48
|
};
|
|
@@ -45,7 +52,7 @@ export async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
45
52
|
const query = Object.entries(paramsMap)
|
|
46
53
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
47
54
|
.join('&');
|
|
48
|
-
return
|
|
55
|
+
return await this.proxyCommand(`/source?${query}`, 'GET') as string;
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
/**
|
|
@@ -76,15 +83,14 @@ export async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
76
83
|
* rawIdentifier: null }
|
|
77
84
|
* ```
|
|
78
85
|
*/
|
|
79
|
-
function getTreeForXML(srcTree) {
|
|
80
|
-
function getTree(element, elementIndex, parentPath) {
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
function getTreeForXML(srcTree: any): any {
|
|
87
|
+
function getTree(element: any, elementIndex: number, parentPath: string): any {
|
|
88
|
+
const curPath = `${parentPath}/${elementIndex}`;
|
|
89
|
+
const rect = element.rect || {};
|
|
83
90
|
/**
|
|
84
91
|
* @privateRemarks I don't even want to try to type this right now
|
|
85
|
-
* @type {any}
|
|
86
92
|
*/
|
|
87
|
-
|
|
93
|
+
const subtree: any = {
|
|
88
94
|
'@': {
|
|
89
95
|
type: `XCUIElementType${element.type}`,
|
|
90
96
|
enabled: parseInt(element.isEnabled, 10) === 1,
|
|
@@ -114,11 +120,11 @@ function getTreeForXML(srcTree) {
|
|
|
114
120
|
[`XCUIElementType${element.type}`]: subtree,
|
|
115
121
|
};
|
|
116
122
|
}
|
|
117
|
-
|
|
123
|
+
const tree = getTree(srcTree, 0, '');
|
|
118
124
|
return tree;
|
|
119
125
|
}
|
|
120
126
|
|
|
121
|
-
function getSourceXml(jsonSource) {
|
|
127
|
+
function getSourceXml(jsonSource: any): string {
|
|
122
128
|
return js2xml('AppiumAUT', jsonSource, {
|
|
123
129
|
wrapArray: {enabled: false, elementName: 'element'},
|
|
124
130
|
declaration: {include: true},
|
|
@@ -126,6 +132,3 @@ function getSourceXml(jsonSource) {
|
|
|
126
132
|
});
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
/**
|
|
130
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
131
|
-
*/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type {XCUITestDriver} from '../driver';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sets the page load timeout using W3C protocol.
|
|
5
|
+
*
|
|
6
|
+
* @param ms - Timeout in milliseconds
|
|
7
|
+
*/
|
|
8
|
+
export async function pageLoadTimeoutW3C(
|
|
9
|
+
this: XCUITestDriver,
|
|
10
|
+
ms: number,
|
|
11
|
+
): Promise<void> {
|
|
12
|
+
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sets the page load timeout using MJSONWP protocol.
|
|
17
|
+
*
|
|
18
|
+
* @param ms - Timeout in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
export async function pageLoadTimeoutMJSONWP(
|
|
21
|
+
this: XCUITestDriver,
|
|
22
|
+
ms: number,
|
|
23
|
+
): Promise<void> {
|
|
24
|
+
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sets the async script timeout using W3C protocol.
|
|
29
|
+
*
|
|
30
|
+
* @param ms - Timeout in milliseconds
|
|
31
|
+
*/
|
|
32
|
+
export async function scriptTimeoutW3C(
|
|
33
|
+
this: XCUITestDriver,
|
|
34
|
+
ms: number,
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
// XXX: this is synchronous
|
|
37
|
+
await this.setAsyncScriptTimeout(this.parseTimeoutArgument(ms));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
42
|
+
*
|
|
43
|
+
* @param ms - The timeout in milliseconds
|
|
44
|
+
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
45
|
+
*/
|
|
46
|
+
export async function scriptTimeoutMJSONWP(
|
|
47
|
+
this: XCUITestDriver,
|
|
48
|
+
ms: number,
|
|
49
|
+
): Promise<void> {
|
|
50
|
+
await this.asyncScriptTimeout(ms);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
55
|
+
*
|
|
56
|
+
* @param ms - The timeout in milliseconds
|
|
57
|
+
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
58
|
+
*/
|
|
59
|
+
export async function asyncScriptTimeout(
|
|
60
|
+
this: XCUITestDriver,
|
|
61
|
+
ms: number,
|
|
62
|
+
): Promise<void> {
|
|
63
|
+
await this.scriptTimeoutW3C(ms);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Sets the page load timeout.
|
|
68
|
+
*
|
|
69
|
+
* @param ms - Timeout in milliseconds
|
|
70
|
+
*/
|
|
71
|
+
export function setPageLoadTimeout(
|
|
72
|
+
this: XCUITestDriver,
|
|
73
|
+
ms: number,
|
|
74
|
+
): void {
|
|
75
|
+
ms = parseInt(String(ms), 10);
|
|
76
|
+
this.pageLoadMs = ms;
|
|
77
|
+
if (this._remote) {
|
|
78
|
+
this.remote.pageLoadMs = ms;
|
|
79
|
+
}
|
|
80
|
+
this.log.debug(`Set page load timeout to ${ms}ms`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Sets the async script timeout.
|
|
85
|
+
*
|
|
86
|
+
* @param ms - Timeout in milliseconds
|
|
87
|
+
*/
|
|
88
|
+
export function setAsyncScriptTimeout(
|
|
89
|
+
this: XCUITestDriver,
|
|
90
|
+
ms: number,
|
|
91
|
+
): void {
|
|
92
|
+
this.asyncWaitMs = ms;
|
|
93
|
+
this.log.debug(`Set async script timeout to ${ms}ms`);
|
|
94
|
+
}
|
|
95
|
+
|
package/lib/commands/types.ts
CHANGED
|
@@ -334,6 +334,29 @@ export interface ProcessArguments {
|
|
|
334
334
|
args: string[];
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Accessibility audit item returned by the audit command.
|
|
339
|
+
*/
|
|
340
|
+
export interface AccessibilityAuditItem {
|
|
341
|
+
/**
|
|
342
|
+
* The detailed description of the found accessibility issue.
|
|
343
|
+
*/
|
|
344
|
+
detailedDescription: string;
|
|
345
|
+
/**
|
|
346
|
+
* The compact description of the found accessibility issue.
|
|
347
|
+
*/
|
|
348
|
+
compactDescription: string;
|
|
349
|
+
/**
|
|
350
|
+
* The name of the audit type this issue belongs to. Could be
|
|
351
|
+
* a number if the type name is unknown.
|
|
352
|
+
*/
|
|
353
|
+
auditType: string | number;
|
|
354
|
+
/**
|
|
355
|
+
* The description of the element this issue was found for.
|
|
356
|
+
*/
|
|
357
|
+
element: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
337
360
|
/**
|
|
338
361
|
* Pressable button names; used by the {@linkcode XCUITest.mobilePressButton mobile: pressButton} command.
|
|
339
362
|
*/
|
|
@@ -646,3 +669,66 @@ export interface LogEntry {
|
|
|
646
669
|
}
|
|
647
670
|
|
|
648
671
|
export type LogListener = (logEntry: LogEntry) => any;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Condition inducer profile configuration
|
|
675
|
+
*/
|
|
676
|
+
export interface Profile {
|
|
677
|
+
name: string;
|
|
678
|
+
/** The property is profileID used in {@linkcode XCUITestDriver.enableConditionInducer} */
|
|
679
|
+
identifier: string;
|
|
680
|
+
/** Configuration details */
|
|
681
|
+
description: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* We can use the returned data to determine whether the Condition is enabled and the currently enabled configuration information
|
|
686
|
+
*/
|
|
687
|
+
export interface Condition {
|
|
688
|
+
profiles: Profile[];
|
|
689
|
+
/** The property is conditionID used in {@linkcode XCUITestDriver.enableConditionInducer} */
|
|
690
|
+
identifier: string;
|
|
691
|
+
profilesSorted: boolean;
|
|
692
|
+
isDestructive: boolean;
|
|
693
|
+
isInternal: boolean;
|
|
694
|
+
/** `true` if this condition identifier is enabled */
|
|
695
|
+
isActive: boolean;
|
|
696
|
+
/** Enabled profiles identifier */
|
|
697
|
+
activeProfile: string;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Information about an XCTest screen recording session
|
|
702
|
+
*/
|
|
703
|
+
export interface XcTestScreenRecordingInfo {
|
|
704
|
+
/** Unique identifier of the video being recorded */
|
|
705
|
+
uuid: string;
|
|
706
|
+
/** FPS value */
|
|
707
|
+
fps: number;
|
|
708
|
+
/** Video codec, where 0 is h264 */
|
|
709
|
+
codec: number;
|
|
710
|
+
/** The timestamp when the screen recording has started in float Unix seconds */
|
|
711
|
+
startedAt: number;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* XCTest screen recording result with payload
|
|
716
|
+
*/
|
|
717
|
+
export interface XcTestScreenRecording extends XcTestScreenRecordingInfo {
|
|
718
|
+
/**
|
|
719
|
+
* Base64-encoded content of the recorded media file if `remotePath` parameter is empty or null or an empty string otherwise.
|
|
720
|
+
* The media is expected to a be a valid QuickTime movie (.mov).
|
|
721
|
+
*/
|
|
722
|
+
payload: string;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Options for AudioRecorder
|
|
727
|
+
*/
|
|
728
|
+
export interface AudioRecorderOptions {
|
|
729
|
+
audioSource: string;
|
|
730
|
+
audioCodec: string;
|
|
731
|
+
audioBitrate: string;
|
|
732
|
+
audioChannels: number;
|
|
733
|
+
audioRate: number;
|
|
734
|
+
}
|