@limrun/appium-xcuitest-driver 10.11.0-lim.3 → 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 +4 -5
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts.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 +11 -3
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +36 -12
- 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/build/lib/simulator-management.js +3 -3
- package/build/lib/simulator-management.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 +3 -6
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +38 -13
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -5
- 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,68 +1,66 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { LogEntry, LogListener } from './types';
|
|
3
|
+
import type { LogDefRecord } from '@appium/types';
|
|
4
|
+
import type { EventEmitter } from 'node:events';
|
|
5
|
+
type XCUITestDriverLogTypes = keyof typeof SUPPORTED_LOG_TYPES;
|
|
6
|
+
interface BiDiListenerProperties {
|
|
7
|
+
type: string;
|
|
8
|
+
srcEventName?: string;
|
|
9
|
+
context?: string;
|
|
10
|
+
entryTransformer?: (x: any) => LogEntry;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @privateRemarks The return types for these getters should be specified
|
|
14
|
+
*/
|
|
15
|
+
declare const SUPPORTED_LOG_TYPES: LogDefRecord;
|
|
16
|
+
export declare const supportedLogTypes: LogDefRecord;
|
|
1
17
|
/**
|
|
18
|
+
* Extracts logs of the specified type from the logs container.
|
|
2
19
|
*
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
5
|
-
* @
|
|
20
|
+
* @param logType - The type of log to extract
|
|
21
|
+
* @param logsContainer - Container holding log objects
|
|
22
|
+
* @returns The extracted logs
|
|
23
|
+
* @throws {Error} If logs are not available or the log type is not found
|
|
6
24
|
*/
|
|
7
|
-
export function extractLogs(this:
|
|
25
|
+
export declare function extractLogs(this: XCUITestDriver, logType: XCUITestDriverLogTypes, logsContainer?: Partial<Record<XCUITestDriverLogTypes, {
|
|
8
26
|
getLogs(): Promise<any>;
|
|
9
27
|
}>>): Promise<any>;
|
|
10
28
|
/**
|
|
11
|
-
*
|
|
29
|
+
* Starts capturing iOS system logs.
|
|
30
|
+
*
|
|
31
|
+
* Initializes and starts capturing syslog and crashlog. Optionally starts Safari console and network logs
|
|
32
|
+
* if the corresponding capabilities are enabled.
|
|
33
|
+
*
|
|
34
|
+
* @returns `true` if syslog capture started successfully; `false` otherwise
|
|
12
35
|
*/
|
|
13
|
-
export function startLogCapture(this:
|
|
14
|
-
export class startLogCapture {
|
|
15
|
-
logs: import("../driver").DriverLogs;
|
|
16
|
-
}
|
|
36
|
+
export declare function startLogCapture(this: XCUITestDriver): Promise<boolean>;
|
|
17
37
|
/**
|
|
18
38
|
* Starts an iOS system logs broadcast websocket.
|
|
19
39
|
*
|
|
20
|
-
* The websocket listens on the same host and port as Appium.
|
|
40
|
+
* The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
|
|
21
41
|
*
|
|
22
42
|
* If the websocket is already running, this command does nothing.
|
|
23
43
|
*
|
|
24
|
-
* Each connected
|
|
44
|
+
* Each connected websocket listener will receive syslog lines as soon as they are visible to Appium.
|
|
25
45
|
* @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
|
|
26
|
-
* @returns {Promise<void>}
|
|
27
|
-
* @this {XCUITestDriver}
|
|
28
46
|
*/
|
|
29
|
-
export function mobileStartLogsBroadcast(this:
|
|
30
|
-
export class mobileStartLogsBroadcast {
|
|
31
|
-
_syslogWebsocketListener: ((logRecord: {
|
|
32
|
-
message: string;
|
|
33
|
-
}) => void) | null;
|
|
34
|
-
}
|
|
47
|
+
export declare function mobileStartLogsBroadcast(this: XCUITestDriver): Promise<void>;
|
|
35
48
|
/**
|
|
36
|
-
* Stops the syslog broadcasting
|
|
49
|
+
* Stops the syslog broadcasting websocket server previously started by `mobile: startLogsBroadcast`.
|
|
50
|
+
*
|
|
37
51
|
* If no websocket server is running, this command does nothing.
|
|
38
|
-
* @this {XCUITestDriver}
|
|
39
|
-
* @returns {Promise<void>}
|
|
40
52
|
*/
|
|
41
|
-
export function mobileStopLogsBroadcast(this:
|
|
53
|
+
export declare function mobileStopLogsBroadcast(this: XCUITestDriver): Promise<void>;
|
|
42
54
|
/**
|
|
55
|
+
* Assigns a BiDi log listener to the given log emitter.
|
|
56
|
+
*
|
|
43
57
|
* https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
|
|
44
58
|
*
|
|
45
|
-
* @template
|
|
46
|
-
* @
|
|
47
|
-
* @param
|
|
48
|
-
* @
|
|
49
|
-
* @returns {[EE, import('./types').LogListener]}
|
|
50
|
-
*/
|
|
51
|
-
export function assignBiDiLogListener<EE extends import("node:events").EventEmitter>(this: import("../driver").XCUITestDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, import("./types").LogListener];
|
|
52
|
-
export const supportedLogTypes: import("@appium/types").LogDefRecord;
|
|
53
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
54
|
-
export type XCUITestDriverLogTypes = keyof typeof SUPPORTED_LOG_TYPES;
|
|
55
|
-
export type AppiumServer = import("@appium/types").AppiumServer;
|
|
56
|
-
export type BiDiListenerProperties = {
|
|
57
|
-
type: string;
|
|
58
|
-
srcEventName?: string | undefined;
|
|
59
|
-
context?: string | undefined;
|
|
60
|
-
entryTransformer?: ((x: any) => import("./types").LogEntry) | undefined;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @type {import('@appium/types').LogDefRecord}
|
|
64
|
-
* @privateRemarks The return types for these getters should be specified
|
|
59
|
+
* @template EE extends EventEmitter
|
|
60
|
+
* @param logEmitter - The event emitter to attach the listener to
|
|
61
|
+
* @param properties - Configuration for the BiDi listener
|
|
62
|
+
* @returns A tuple containing the log emitter and the listener function
|
|
65
63
|
*/
|
|
66
|
-
declare
|
|
64
|
+
export declare function assignBiDiLogListener<EE extends EventEmitter>(this: XCUITestDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, LogListener];
|
|
67
65
|
export {};
|
|
68
66
|
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAC,YAAY,EAAyB,MAAM,eAAe,CAAC;AAExE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAU9C,KAAK,sBAAsB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE/D,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,QAAQ,CAAC;CACzC;AAED;;GAEG;AACH,QAAA,MAAM,mBAAmB,EAAE,YA4B1B,CAAC;AAQF,eAAO,MAAM,iBAAiB,cAAsB,CAAC;AAErD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,sBAAsB,EAC/B,aAAa,GAAE,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE;IAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;CAAC,CAAC,CAAM,GACrF,OAAO,CAAC,GAAG,CAAC,CAqBd;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAoF5E;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDlF;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,YAAY,EAC3D,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,EAAE,EACd,UAAU,EAAE,sBAAsB,GACjC,CAAC,EAAE,EAAE,WAAW,CAAC,CAanB"}
|
|
@@ -24,14 +24,11 @@ const constants_1 = require("./bidi/constants");
|
|
|
24
24
|
const models_1 = require("./bidi/models");
|
|
25
25
|
/**
|
|
26
26
|
* Determines the websocket endpoint based on the `sessionId`
|
|
27
|
-
* @param {string} sessionId
|
|
28
|
-
* @returns {string}
|
|
29
27
|
*/
|
|
30
28
|
const WEBSOCKET_ENDPOINT = (sessionId) => `${driver_1.DEFAULT_WS_PATHNAME_PREFIX}/session/${sessionId}/appium/device/syslog`;
|
|
31
29
|
const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-control-regex
|
|
32
30
|
const GET_SERVER_LOGS_FEATURE = 'get_server_logs';
|
|
33
31
|
/**
|
|
34
|
-
* @type {import('@appium/types').LogDefRecord}
|
|
35
32
|
* @privateRemarks The return types for these getters should be specified
|
|
36
33
|
*/
|
|
37
34
|
const SUPPORTED_LOG_TYPES = {
|
|
@@ -57,9 +54,6 @@ const SUPPORTED_LOG_TYPES = {
|
|
|
57
54
|
},
|
|
58
55
|
server: {
|
|
59
56
|
description: 'Appium server logs',
|
|
60
|
-
/**
|
|
61
|
-
* @returns {import('./types').LogEntry[]}
|
|
62
|
-
*/
|
|
63
57
|
getter: (self) => {
|
|
64
58
|
self.assertFeatureEnabled(GET_SERVER_LOGS_FEATURE);
|
|
65
59
|
return self.log.unwrap().record.map(nativeLogEntryToSeleniumEntry);
|
|
@@ -73,10 +67,12 @@ const LOG_NAMES_TO_CAPABILITY_NAMES_MAP = {
|
|
|
73
67
|
};
|
|
74
68
|
exports.supportedLogTypes = SUPPORTED_LOG_TYPES;
|
|
75
69
|
/**
|
|
70
|
+
* Extracts logs of the specified type from the logs container.
|
|
76
71
|
*
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
72
|
+
* @param logType - The type of log to extract
|
|
73
|
+
* @param logsContainer - Container holding log objects
|
|
74
|
+
* @returns The extracted logs
|
|
75
|
+
* @throws {Error} If logs are not available or the log type is not found
|
|
80
76
|
*/
|
|
81
77
|
async function extractLogs(logType, logsContainer = {}) {
|
|
82
78
|
// make sure that we have logs at all
|
|
@@ -96,7 +92,12 @@ async function extractLogs(logType, logsContainer = {}) {
|
|
|
96
92
|
throw new Error(`No logs of type '${logType}' found. Supported log types are: ${lodash_1.default.keys(SUPPORTED_LOG_TYPES)}.`);
|
|
97
93
|
}
|
|
98
94
|
/**
|
|
99
|
-
*
|
|
95
|
+
* Starts capturing iOS system logs.
|
|
96
|
+
*
|
|
97
|
+
* Initializes and starts capturing syslog and crashlog. Optionally starts Safari console and network logs
|
|
98
|
+
* if the corresponding capabilities are enabled.
|
|
99
|
+
*
|
|
100
|
+
* @returns `true` if syslog capture started successfully; `false` otherwise
|
|
100
101
|
*/
|
|
101
102
|
async function startLogCapture() {
|
|
102
103
|
this.logs = this.logs || {};
|
|
@@ -106,7 +107,7 @@ async function startLogCapture() {
|
|
|
106
107
|
}
|
|
107
108
|
if (lodash_1.default.isUndefined(this.logs.syslog)) {
|
|
108
109
|
[this.logs.crashlog,] = assignBiDiLogListener.bind(this)(new ios_crash_log_1.IOSCrashLog({
|
|
109
|
-
sim:
|
|
110
|
+
sim: this.device,
|
|
110
111
|
udid: this.isRealDevice() ? this.opts.udid : undefined,
|
|
111
112
|
log: this.log,
|
|
112
113
|
}), {
|
|
@@ -114,12 +115,12 @@ async function startLogCapture() {
|
|
|
114
115
|
});
|
|
115
116
|
[this.logs.syslog,] = assignBiDiLogListener.bind(this)(this.isRealDevice()
|
|
116
117
|
? new ios_device_log_1.IOSDeviceLog({
|
|
117
|
-
udid:
|
|
118
|
+
udid: this.opts.udid,
|
|
118
119
|
showLogs: this.opts.showIOSLog,
|
|
119
120
|
log: this.log,
|
|
120
121
|
})
|
|
121
122
|
: new ios_simulator_log_1.IOSSimulatorLog({
|
|
122
|
-
sim:
|
|
123
|
+
sim: this.device,
|
|
123
124
|
showLogs: this.opts.showIOSLog,
|
|
124
125
|
iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
|
|
125
126
|
simulatorLogLevel: this.opts.simulatorLogLevel,
|
|
@@ -153,7 +154,6 @@ async function startLogCapture() {
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
let didStartSyslog = false;
|
|
156
|
-
/** @type {Promise[]} */
|
|
157
157
|
const promises = [
|
|
158
158
|
(async () => {
|
|
159
159
|
try {
|
|
@@ -174,18 +174,16 @@ async function startLogCapture() {
|
|
|
174
174
|
/**
|
|
175
175
|
* Starts an iOS system logs broadcast websocket.
|
|
176
176
|
*
|
|
177
|
-
* The websocket listens on the same host and port as Appium.
|
|
177
|
+
* The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
|
|
178
178
|
*
|
|
179
179
|
* If the websocket is already running, this command does nothing.
|
|
180
180
|
*
|
|
181
|
-
* Each connected
|
|
181
|
+
* Each connected websocket listener will receive syslog lines as soon as they are visible to Appium.
|
|
182
182
|
* @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
|
|
183
|
-
* @returns {Promise<void>}
|
|
184
|
-
* @this {XCUITestDriver}
|
|
185
183
|
*/
|
|
186
184
|
async function mobileStartLogsBroadcast() {
|
|
187
|
-
const pathname = WEBSOCKET_ENDPOINT(
|
|
188
|
-
if (!lodash_1.default.isEmpty(await
|
|
185
|
+
const pathname = WEBSOCKET_ENDPOINT(this.sessionId);
|
|
186
|
+
if (!lodash_1.default.isEmpty(await this.server.getWebSocketHandlers(pathname))) {
|
|
189
187
|
this.log.debug(`The system logs broadcasting web socket server is already listening at ${pathname}`);
|
|
190
188
|
return;
|
|
191
189
|
}
|
|
@@ -227,61 +225,42 @@ async function mobileStartLogsBroadcast() {
|
|
|
227
225
|
this.log.debug(closeMsg);
|
|
228
226
|
});
|
|
229
227
|
});
|
|
230
|
-
await
|
|
231
|
-
/** @type {import('@appium/types').WSServer} */ (wss));
|
|
228
|
+
await this.server.addWebSocketHandler(pathname, wss);
|
|
232
229
|
}
|
|
233
230
|
/**
|
|
234
|
-
* Stops the syslog broadcasting
|
|
231
|
+
* Stops the syslog broadcasting websocket server previously started by `mobile: startLogsBroadcast`.
|
|
232
|
+
*
|
|
235
233
|
* If no websocket server is running, this command does nothing.
|
|
236
|
-
* @this {XCUITestDriver}
|
|
237
|
-
* @returns {Promise<void>}
|
|
238
234
|
*/
|
|
239
235
|
async function mobileStopLogsBroadcast() {
|
|
240
|
-
const pathname = WEBSOCKET_ENDPOINT(
|
|
241
|
-
if (lodash_1.default.isEmpty(await
|
|
236
|
+
const pathname = WEBSOCKET_ENDPOINT(this.sessionId);
|
|
237
|
+
if (lodash_1.default.isEmpty(await this.server.getWebSocketHandlers(pathname))) {
|
|
242
238
|
return;
|
|
243
239
|
}
|
|
244
240
|
this.log.debug('Stopping the system logs broadcasting web socket server');
|
|
245
|
-
await
|
|
241
|
+
await this.server.removeWebSocketHandler(pathname);
|
|
246
242
|
}
|
|
247
243
|
/**
|
|
244
|
+
* Assigns a BiDi log listener to the given log emitter.
|
|
245
|
+
*
|
|
248
246
|
* https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
|
|
249
247
|
*
|
|
250
|
-
* @template
|
|
251
|
-
* @
|
|
252
|
-
* @param
|
|
253
|
-
* @
|
|
254
|
-
* @returns {[EE, import('./types').LogListener]}
|
|
248
|
+
* @template EE extends EventEmitter
|
|
249
|
+
* @param logEmitter - The event emitter to attach the listener to
|
|
250
|
+
* @param properties - Configuration for the BiDi listener
|
|
251
|
+
* @returns A tuple containing the log emitter and the listener function
|
|
255
252
|
*/
|
|
256
253
|
function assignBiDiLogListener(logEmitter, properties) {
|
|
257
254
|
const { type, context = utils_1.NATIVE_WIN, srcEventName = 'output', entryTransformer, } = properties;
|
|
258
|
-
const listener = (
|
|
255
|
+
const listener = (logEntry) => {
|
|
259
256
|
const finalEntry = entryTransformer ? entryTransformer(logEntry) : logEntry;
|
|
260
257
|
this.eventEmitter.emit(constants_1.BIDI_EVENT_NAME, (0, models_1.makeLogEntryAddedEvent)(finalEntry, context, type));
|
|
261
258
|
};
|
|
262
259
|
logEmitter.on(srcEventName, listener);
|
|
263
260
|
return [logEmitter, listener];
|
|
264
261
|
}
|
|
265
|
-
/**
|
|
266
|
-
*
|
|
267
|
-
* @param {Object} x
|
|
268
|
-
* @returns {import('./types').LogEntry}
|
|
269
|
-
*/
|
|
270
262
|
function nativeLogEntryToSeleniumEntry(x) {
|
|
271
263
|
const msg = lodash_1.default.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
|
|
272
|
-
return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''),
|
|
273
|
-
/** @type {any} */ (x).timestamp ?? Date.now());
|
|
264
|
+
return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''), x.timestamp ?? Date.now());
|
|
274
265
|
}
|
|
275
|
-
/**
|
|
276
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
277
|
-
* @typedef {keyof typeof SUPPORTED_LOG_TYPES} XCUITestDriverLogTypes
|
|
278
|
-
* @typedef {import('@appium/types').AppiumServer} AppiumServer
|
|
279
|
-
*/
|
|
280
|
-
/**
|
|
281
|
-
* @typedef {Object} BiDiListenerProperties
|
|
282
|
-
* @property {string} type
|
|
283
|
-
* @property {string} [srcEventName='output']
|
|
284
|
-
* @property {string} [context=NATIVE_WIN]
|
|
285
|
-
* @property {(x: Object) => import('./types').LogEntry} [entryTransformer]
|
|
286
|
-
*/
|
|
287
266
|
//# sourceMappingURL=log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.ts"],"names":[],"mappings":";;;;;;AAqFA,kCAyBC;AAUD,0CAoFC;AAYD,4DAyDC;AAOD,0DAQC;AAYD,sDAiBC;AA7TD,oDAAuB;AACvB,wDAAyB;AACzB,0CAAyD;AACzD,+DAAwD;AACxD,uEAAgE;AAChE,iEAA0D;AAC1D,4CAA2B;AAC3B,yEAAoE;AACpE,yEAAoE;AACpE,mDAAmD;AACnD,oCAA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7F,CAAC,CAAC;IACF,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,6BAA6B,CAAC,CAAM;IAC3C,MAAM,GAAG,GAAG,gBAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3E,OAAO,IAAA,oBAAU,EACf,gBAAC,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,CAAC,EACtC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Simulates Low Memory warning on the given application
|
|
3
4
|
*
|
|
4
5
|
* @since Xcode 15
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
7
|
-
* @throws {Error} if the app is not running or is not installed
|
|
6
|
+
* @param bundleId - The bundle identifier of the target app. The app must be running
|
|
7
|
+
* @throws If the app is not running or is not installed
|
|
8
8
|
*/
|
|
9
|
-
export function mobileSendMemoryWarning(this:
|
|
10
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
9
|
+
export declare function mobileSendMemoryWarning(this: XCUITestDriver, bundleId: string): Promise<void>;
|
|
11
10
|
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../lib/commands/memory.
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../lib/commands/memory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAG9C;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|
|
@@ -10,15 +10,14 @@ const driver_1 = require("appium/driver");
|
|
|
10
10
|
* Simulates Low Memory warning on the given application
|
|
11
11
|
*
|
|
12
12
|
* @since Xcode 15
|
|
13
|
-
* @param
|
|
14
|
-
* @
|
|
15
|
-
* @throws {Error} if the app is not running or is not installed
|
|
13
|
+
* @param bundleId - The bundle identifier of the target app. The app must be running
|
|
14
|
+
* @throws If the app is not running or is not installed
|
|
16
15
|
*/
|
|
17
16
|
async function mobileSendMemoryWarning(bundleId) {
|
|
18
17
|
if (!this.isRealDevice()) {
|
|
19
18
|
throw new Error('Memory warning simulation is only supported on real devices');
|
|
20
19
|
}
|
|
21
|
-
const device =
|
|
20
|
+
const device = this.device;
|
|
22
21
|
const appInfos = await device.devicectl.listApps(bundleId);
|
|
23
22
|
if (lodash_1.default.isEmpty(appInfos)) {
|
|
24
23
|
throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} cannot be found on the device. Is it installed?`);
|
|
@@ -33,7 +32,6 @@ async function mobileSendMemoryWarning(bundleId) {
|
|
|
33
32
|
// Unfortunately devicectl does not provide more info which would
|
|
34
33
|
// allow to connect a bundle id to a process id.
|
|
35
34
|
const pattern = new RegExp(`^${lodash_1.default.escapeRegExp(appInfos[0].url)}[^/]+$`);
|
|
36
|
-
/** @type {number[]} */
|
|
37
35
|
const pids = (await device.devicectl.listProcesses())
|
|
38
36
|
.filter(({ executable }) => pattern.test(executable))
|
|
39
37
|
.map(({ processIdentifier }) => processIdentifier);
|
|
@@ -43,7 +41,4 @@ async function mobileSendMemoryWarning(bundleId) {
|
|
|
43
41
|
this.log.info(`Emulating Low Memory warning for the process id ${pids[0]}, bundle id ${bundleId}`);
|
|
44
42
|
await device.devicectl.sendMemoryWarning(pids[0]);
|
|
45
43
|
}
|
|
46
|
-
/**
|
|
47
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
48
|
-
*/
|
|
49
44
|
//# sourceMappingURL=memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../lib/commands/memory.
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../lib/commands/memory.ts"],"names":[],"mappings":";;;;;AAYA,0DAqCC;AAjDD,oDAAuB;AACvB,0CAAuC;AAIvC;;;;;;GAMG;AACI,KAAK,UAAU,uBAAuB,CAE3C,QAAgB;IAEhB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAoB,CAAC;IAEzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3D,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,iCAAiC,QAAQ,kDAAkD,CAC5F,CAAC;IACJ,CAAC;IAED,6EAA6E;IAC7E,gDAAgD;IAChD,uGAAuG;IACvG,gDAAgD;IAChD,6GAA6G;IAC7G,oJAAoJ;IACpJ,4CAA4C;IAC5C,iEAAiE;IACjE,gDAAgD;IAChD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,gBAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxE,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;SAClD,MAAM,CAAC,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAClD,GAAG,CAAC,CAAC,EAAC,iBAAiB,EAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACnD,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,iCAAiC,QAAQ,8DAA8D,CACxG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mDAAmD,IAAI,CAAC,CAAC,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC;IACnG,MAAM,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,44 +1,32 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* Navigate back in the browser history or native app navigation.
|
|
3
4
|
*/
|
|
4
|
-
export function back(this:
|
|
5
|
+
export declare function back(this: XCUITestDriver): Promise<void>;
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Navigate forward in the browser history.
|
|
7
8
|
*/
|
|
8
|
-
export function forward(this:
|
|
9
|
+
export declare function forward(this: XCUITestDriver): Promise<void>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Closes the current window in a web context.
|
|
12
|
+
*
|
|
13
|
+
* @returns Promise that resolves when the window is closed
|
|
11
14
|
*/
|
|
12
|
-
export function closeWindow(this:
|
|
15
|
+
export declare function closeWindow(this: XCUITestDriver): Promise<any>;
|
|
13
16
|
/**
|
|
14
17
|
* Opens the given URL with the default application assigned to handle it based on the URL
|
|
15
18
|
* scheme, or the application provided as an optional parameter
|
|
16
19
|
*
|
|
17
20
|
* (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
|
|
18
21
|
*
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
22
|
+
* @param url - the URL to be opened, e.g. `myscheme://yolo`
|
|
23
|
+
* @param bundleId - the application to open the given URL with. If not provided, then
|
|
21
24
|
* the application assigned by the operating system to handle URLs of the appropriate type
|
|
22
|
-
* @returns {Promise<void>}
|
|
23
25
|
* @since 4.17
|
|
24
|
-
* @this {XCUITestDriver}
|
|
25
26
|
*/
|
|
26
|
-
export function mobileDeepLink(this:
|
|
27
|
+
export declare function mobileDeepLink(this: XCUITestDriver, url: string, bundleId?: string): Promise<void>;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Navigate back in native app navigation by finding and clicking the back button.
|
|
29
30
|
*/
|
|
30
|
-
export function nativeBack(this:
|
|
31
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
32
|
-
export type DeepLinkOptions = {
|
|
33
|
-
/**
|
|
34
|
-
* The URL to be opened. This parameter is manadatory
|
|
35
|
-
*/
|
|
36
|
-
url: string;
|
|
37
|
-
/**
|
|
38
|
-
* The bundle identifier of an application to open the
|
|
39
|
-
* given url with. If not provided then the default application for the given url scheme
|
|
40
|
-
* is going to be used.
|
|
41
|
-
*/
|
|
42
|
-
bundleId: string | null;
|
|
43
|
-
};
|
|
31
|
+
export declare function nativeBack(this: XCUITestDriver): Promise<void>;
|
|
44
32
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAO9C;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAM9D;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAsBpE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCpE"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.back = back;
|
|
7
4
|
exports.forward = forward;
|
|
@@ -9,14 +6,13 @@ exports.closeWindow = closeWindow;
|
|
|
9
6
|
exports.mobileDeepLink = mobileDeepLink;
|
|
10
7
|
exports.nativeBack = nativeBack;
|
|
11
8
|
const driver_1 = require("appium/driver");
|
|
12
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
13
9
|
const asyncbox_1 = require("asyncbox");
|
|
14
10
|
const utils_1 = require("../utils");
|
|
15
11
|
// these two constitute the wait after closing a window
|
|
16
12
|
const CLOSE_WINDOW_TIMEOUT = 5000;
|
|
17
13
|
const CLOSE_WINDOW_INTERVAL = 100;
|
|
18
14
|
/**
|
|
19
|
-
*
|
|
15
|
+
* Navigate back in the browser history or native app navigation.
|
|
20
16
|
*/
|
|
21
17
|
async function back() {
|
|
22
18
|
if (!this.isWebContext()) {
|
|
@@ -27,15 +23,19 @@ async function back() {
|
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
|
-
*
|
|
26
|
+
* Navigate forward in the browser history.
|
|
31
27
|
*/
|
|
32
28
|
async function forward() {
|
|
33
29
|
if (!this.isWebContext()) {
|
|
30
|
+
// No-op for native context
|
|
31
|
+
return;
|
|
34
32
|
}
|
|
35
33
|
await this.mobileWebNav('forward');
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
38
|
-
*
|
|
36
|
+
* Closes the current window in a web context.
|
|
37
|
+
*
|
|
38
|
+
* @returns Promise that resolves when the window is closed
|
|
39
39
|
*/
|
|
40
40
|
async function closeWindow() {
|
|
41
41
|
if (!this.isWebContext()) {
|
|
@@ -67,12 +67,10 @@ async function closeWindow() {
|
|
|
67
67
|
*
|
|
68
68
|
* (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
|
|
69
69
|
*
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
70
|
+
* @param url - the URL to be opened, e.g. `myscheme://yolo`
|
|
71
|
+
* @param bundleId - the application to open the given URL with. If not provided, then
|
|
72
72
|
* the application assigned by the operating system to handle URLs of the appropriate type
|
|
73
|
-
* @returns {Promise<void>}
|
|
74
73
|
* @since 4.17
|
|
75
|
-
* @this {XCUITestDriver}
|
|
76
74
|
*/
|
|
77
75
|
async function mobileDeepLink(url, bundleId) {
|
|
78
76
|
return await this.proxyCommand('/url', 'POST', {
|
|
@@ -81,7 +79,7 @@ async function mobileDeepLink(url, bundleId) {
|
|
|
81
79
|
});
|
|
82
80
|
}
|
|
83
81
|
/**
|
|
84
|
-
*
|
|
82
|
+
* Navigate back in native app navigation by finding and clicking the back button.
|
|
85
83
|
*/
|
|
86
84
|
async function nativeBack() {
|
|
87
85
|
if ((0, utils_1.isTvOs)(this.opts.platformName)) {
|
|
@@ -89,33 +87,25 @@ async function nativeBack() {
|
|
|
89
87
|
return await this.mobilePressButton('Menu');
|
|
90
88
|
}
|
|
91
89
|
try {
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
const navBar = await this.findNativeElementOrElements('class name', 'XCUIElementTypeNavigationBar', false);
|
|
91
|
+
let dstButton;
|
|
92
|
+
const backButtons = await this.findNativeElementOrElements('-ios predicate string', 'type == "XCUIElementTypeButton" AND label == "Back"', true, navBar);
|
|
93
|
+
if (backButtons.length === 0) {
|
|
94
|
+
const buttons = await this.findNativeElementOrElements('-ios predicate string', 'type == "XCUIElementTypeButton"', true, navBar);
|
|
95
|
+
if (buttons.length === 0) {
|
|
96
|
+
throw new Error('No buttons found in navigation bar');
|
|
97
|
+
}
|
|
99
98
|
this.log.debug(`Found navigation bar 'back' button. Clicking.`);
|
|
99
|
+
dstButton = buttons[0];
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
|
-
this.log.debug(`
|
|
103
|
-
|
|
102
|
+
this.log.debug(`Did not find any navigation bar 'back' button. Clicking the first one.`);
|
|
103
|
+
dstButton = backButtons[0];
|
|
104
104
|
}
|
|
105
|
-
await this.nativeClick(
|
|
105
|
+
await this.nativeClick(dstButton);
|
|
106
106
|
}
|
|
107
107
|
catch (err) {
|
|
108
108
|
this.log.error(`Unable to find navigation bar and back button: ${err.message}`);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
/**
|
|
112
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
113
|
-
*/
|
|
114
|
-
/**
|
|
115
|
-
* @typedef {Object} DeepLinkOptions
|
|
116
|
-
* @property {string} url The URL to be opened. This parameter is manadatory
|
|
117
|
-
* @property {string?} bundleId The bundle identifier of an application to open the
|
|
118
|
-
* given url with. If not provided then the default application for the given url scheme
|
|
119
|
-
* is going to be used.
|
|
120
|
-
*/
|
|
121
111
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":";;AAaA,oBAMC;AAKD,0BAMC;AAOD,kCAsBC;AAaD,wCASC;AAKD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