appium-safari-driver 3.5.21 → 3.5.23
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/commands/cookies.d.ts +6 -4
- package/build/lib/commands/cookies.d.ts.map +1 -1
- package/build/lib/commands/cookies.js +10 -6
- package/build/lib/commands/cookies.js.map +1 -1
- package/build/lib/commands/find.d.ts +11 -4
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +16 -8
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/record-screen.d.ts +113 -56
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +11 -6
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/driver.d.ts +10 -2
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +46 -11
- package/build/lib/driver.js.map +1 -1
- package/build/lib/safari.d.ts +18 -6
- package/build/lib/safari.d.ts.map +1 -1
- package/build/lib/safari.js +22 -3
- package/build/lib/safari.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/cookies.js +9 -5
- package/lib/commands/find.js +15 -11
- package/lib/commands/record-screen.js +9 -8
- package/lib/driver.js +18 -8
- package/lib/safari.js +25 -4
- package/npm-shrinkwrap.json +36 -209
- package/package.json +1 -1
- package/build/lib/commands/index.d.ts +0 -3
- package/build/lib/commands/index.d.ts.map +0 -1
- package/build/lib/commands/index.js +0 -14
- package/build/lib/commands/index.js.map +0 -1
- package/lib/commands/index.js +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [3.5.23](https://github.com/appium/appium-safari-driver/compare/v3.5.22...v3.5.23) (2025-02-21)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Accept reqBasePath proxy option ([#137](https://github.com/appium/appium-safari-driver/issues/137)) ([a0357bb](https://github.com/appium/appium-safari-driver/commit/a0357bb066b3bbc520f21f979a1f9d6c2efc54db))
|
|
6
|
+
|
|
7
|
+
## [3.5.22](https://github.com/appium/appium-safari-driver/compare/v3.5.21...v3.5.22) (2025-02-02)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* Improve typing ([#135](https://github.com/appium/appium-safari-driver/issues/135)) ([f63a347](https://github.com/appium/appium-safari-driver/commit/f63a3474efd70c200423058b7323e26626e7b27d))
|
|
12
|
+
|
|
1
13
|
## [3.5.21](https://github.com/appium/appium-safari-driver/compare/v3.5.20...v3.5.21) (2025-01-28)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @this {SafariDriver}
|
|
3
|
+
* @returns {Promise<any>}
|
|
4
|
+
*/
|
|
5
|
+
export function deleteCookies(this: import("../driver").SafariDriver): Promise<any>;
|
|
6
|
+
export type SafariDriver = import("../driver").SafariDriver;
|
|
5
7
|
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/commands/cookies.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/commands/cookies.js"],"names":[],"mappings":"AACA;;;GAGG;AACH,uEAFa,OAAO,CAAC,GAAG,CAAC,CAIxB;2BAGY,OAAO,WAAW,EAAE,YAAY"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
exports.deleteCookies = deleteCookies;
|
|
4
|
+
/**
|
|
5
|
+
* @this {SafariDriver}
|
|
6
|
+
* @returns {Promise<any>}
|
|
7
|
+
*/
|
|
8
|
+
async function deleteCookies() {
|
|
7
9
|
return await this.safari.proxy.command('/cookie', 'DELETE');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import('../driver').SafariDriver} SafariDriver
|
|
13
|
+
*/
|
|
10
14
|
//# sourceMappingURL=cookies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/commands/cookies.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/commands/cookies.js"],"names":[],"mappings":";;AAKA,sCAEC;AAND;;;GAGG;AACI,KAAK,UAAU,aAAa;IACjC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @this {SafariDriver}
|
|
4
|
+
* @param {string} strategy
|
|
5
|
+
* @param {string} selector
|
|
6
|
+
* @param {boolean} mult
|
|
7
|
+
* @param {string} [context]
|
|
8
|
+
* @returns {Promise<any>}
|
|
9
|
+
*/
|
|
10
|
+
export function findElOrEls(this: import("../driver").SafariDriver, strategy: string, selector: string, mult: boolean, context?: string): Promise<any>;
|
|
11
|
+
export type SafariDriver = import("../driver").SafariDriver;
|
|
5
12
|
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,8EANW,MAAM,YACN,MAAM,QACN,OAAO,YACP,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAQxB;2BAGY,OAAO,WAAW,EAAE,YAAY"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findElOrEls = findElOrEls;
|
|
4
4
|
const support_1 = require("appium/support");
|
|
5
|
-
const commands = {};
|
|
6
|
-
exports.commands = commands;
|
|
7
5
|
// This is needed to make lookup by image working
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @this {SafariDriver}
|
|
9
|
+
* @param {string} strategy
|
|
10
|
+
* @param {string} selector
|
|
11
|
+
* @param {boolean} mult
|
|
12
|
+
* @param {string} [context]
|
|
13
|
+
* @returns {Promise<any>}
|
|
14
|
+
*/
|
|
15
|
+
async function findElOrEls(strategy, selector, mult, context) {
|
|
16
|
+
const endpoint = `/element${context ? `/${support_1.util.unwrapElement(context)}/element` : ''}${mult ? 's' : ''}`;
|
|
11
17
|
return await this.safari.proxy.command(endpoint, 'POST', {
|
|
12
18
|
using: strategy,
|
|
13
19
|
value: selector,
|
|
14
20
|
});
|
|
15
|
-
}
|
|
16
|
-
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @typedef {import('../driver').SafariDriver} SafariDriver
|
|
24
|
+
*/
|
|
17
25
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":";;AAYA,kCAMC;AAlBD,4CAAsC;AAEtC,iDAAiD;AACjD;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO;IAClE,MAAM,QAAQ,GAAG,WAAW,OAAO,CAAC,CAAC,CAAC,IAAI,cAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACzG,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE;QACvD,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;GAEG"}
|
|
@@ -1,4 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} StartRecordingOptions
|
|
3
|
+
*
|
|
4
|
+
* @property {string} codec [hevc] - Specifies the codec type: "h264" or "hevc"
|
|
5
|
+
* @property {string} display [internal] - Supports "internal" or "external". Default is "internal"
|
|
6
|
+
* @property {string} mask - For non-rectangular displays, handle the mask by policy:
|
|
7
|
+
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
|
|
8
|
+
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
|
|
9
|
+
* - black: The mask is rendered black.
|
|
10
|
+
* @property {string|number} timeLimit [600] - The maximum recording time, in seconds. The default
|
|
11
|
+
* value is 600 seconds (10 minutes).
|
|
12
|
+
* @property {boolean} forceRestart [true] - Whether to ignore the call if a screen recording is currently running
|
|
13
|
+
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Record the Simulator's display in background while the automated test is running.
|
|
17
|
+
* This method uses `xcrun simctl io recordVideo` helper under the hood.
|
|
18
|
+
* Check the output of `xcrun simctl io` command for more details.
|
|
19
|
+
*
|
|
20
|
+
* @this {SafariDriver}
|
|
21
|
+
* @param {StartRecordingOptions} options - The available options.
|
|
22
|
+
* @this {import('../driver').SafariDriver}
|
|
23
|
+
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
|
|
24
|
+
*/
|
|
25
|
+
export function startRecordingScreen(this: import("../driver").SafariDriver, options: StartRecordingOptions): Promise<void>;
|
|
26
|
+
export class startRecordingScreen {
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} StartRecordingOptions
|
|
29
|
+
*
|
|
30
|
+
* @property {string} codec [hevc] - Specifies the codec type: "h264" or "hevc"
|
|
31
|
+
* @property {string} display [internal] - Supports "internal" or "external". Default is "internal"
|
|
32
|
+
* @property {string} mask - For non-rectangular displays, handle the mask by policy:
|
|
33
|
+
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
|
|
34
|
+
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
|
|
35
|
+
* - black: The mask is rendered black.
|
|
36
|
+
* @property {string|number} timeLimit [600] - The maximum recording time, in seconds. The default
|
|
37
|
+
* value is 600 seconds (10 minutes).
|
|
38
|
+
* @property {boolean} forceRestart [true] - Whether to ignore the call if a screen recording is currently running
|
|
39
|
+
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Record the Simulator's display in background while the automated test is running.
|
|
43
|
+
* This method uses `xcrun simctl io recordVideo` helper under the hood.
|
|
44
|
+
* Check the output of `xcrun simctl io` command for more details.
|
|
45
|
+
*
|
|
46
|
+
* @this {SafariDriver}
|
|
47
|
+
* @param {StartRecordingOptions} options - The available options.
|
|
48
|
+
* @this {import('../driver').SafariDriver}
|
|
49
|
+
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
|
|
50
|
+
*/
|
|
51
|
+
constructor(this: import("../driver").SafariDriver, options: StartRecordingOptions);
|
|
52
|
+
_screenRecorder: ScreenRecorder;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {Object} StopRecordingOptions
|
|
56
|
+
*
|
|
57
|
+
* @property {string} remotePath - The path to the remote location, where the resulting video should be uploaded.
|
|
58
|
+
* The following protocols are supported: http/https, ftp.
|
|
59
|
+
* Null or empty string value (the default setting) means the content of resulting
|
|
60
|
+
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
61
|
+
* An exception will be thrown if the generated media file is too big to
|
|
62
|
+
* fit into the available process memory.
|
|
63
|
+
* @property {string} user - The name of the user for the remote authentication.
|
|
64
|
+
* @property {string} pass - The password for the remote authentication.
|
|
65
|
+
* @property {string} method - The http multipart upload method name. The 'PUT' one is used by default.
|
|
66
|
+
* @property {Object} headers - Additional headers mapping for multipart http(s) uploads
|
|
67
|
+
* @property {string} fileFieldName [file] - The name of the form field, where the file content BLOB should be stored for
|
|
68
|
+
* http(s) uploads
|
|
69
|
+
* @property {Object|[string, string][]} formFields - Additional form fields for multipart http(s) uploads
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Stop recording the screen.
|
|
73
|
+
* If no screen recording has been started before then the method returns an empty string.
|
|
74
|
+
*
|
|
75
|
+
* @this {SafariDriver}
|
|
76
|
+
* @param {StopRecordingOptions} options - The available options.
|
|
77
|
+
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
78
|
+
* parameter is falsy or an empty string.
|
|
79
|
+
* @this {import('../driver').SafariDriver}
|
|
80
|
+
* @throws {Error} If there was an error while getting the name of a media file
|
|
81
|
+
* or the file content cannot be uploaded to the remote location
|
|
82
|
+
* or screen recording is not supported on the device under test.
|
|
83
|
+
*/
|
|
84
|
+
export function stopRecordingScreen(this: import("../driver").SafariDriver, options: StopRecordingOptions): Promise<string>;
|
|
2
85
|
export type StartRecordingOptions = {
|
|
3
86
|
/**
|
|
4
87
|
* [hevc] - Specifies the codec type: "h264" or "hevc"
|
|
@@ -62,60 +145,34 @@ export type StopRecordingOptions = {
|
|
|
62
145
|
*/
|
|
63
146
|
formFields: any | [string, string][];
|
|
64
147
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
70
|
-
* @
|
|
71
|
-
* @
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* @property {string} remotePath - The path to the remote location, where the resulting video should be uploaded.
|
|
94
|
-
* The following protocols are supported: http/https, ftp.
|
|
95
|
-
* Null or empty string value (the default setting) means the content of resulting
|
|
96
|
-
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
97
|
-
* An exception will be thrown if the generated media file is too big to
|
|
98
|
-
* fit into the available process memory.
|
|
99
|
-
* @property {string} user - The name of the user for the remote authentication.
|
|
100
|
-
* @property {string} pass - The password for the remote authentication.
|
|
101
|
-
* @property {string} method - The http multipart upload method name. The 'PUT' one is used by default.
|
|
102
|
-
* @property {Object} headers - Additional headers mapping for multipart http(s) uploads
|
|
103
|
-
* @property {string} fileFieldName [file] - The name of the form field, where the file content BLOB should be stored for
|
|
104
|
-
* http(s) uploads
|
|
105
|
-
* @property {Object|[string, string][]} formFields - Additional form fields for multipart http(s) uploads
|
|
106
|
-
*/
|
|
107
|
-
/**
|
|
108
|
-
* Stop recording the screen.
|
|
109
|
-
* If no screen recording has been started before then the method returns an empty string.
|
|
110
|
-
*
|
|
111
|
-
* @param {StopRecordingOptions} options - The available options.
|
|
112
|
-
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
113
|
-
* parameter is falsy or an empty string.
|
|
114
|
-
* @this {import('../driver').SafariDriver}
|
|
115
|
-
* @throws {Error} If there was an error while getting the name of a media file
|
|
116
|
-
* or the file content cannot be uploaded to the remote location
|
|
117
|
-
* or screen recording is not supported on the device under test.
|
|
118
|
-
*/
|
|
119
|
-
function stopRecordingScreen(this: import("../driver").SafariDriver, options: StopRecordingOptions): Promise<string>;
|
|
148
|
+
export type SafariDriver = import("../driver").SafariDriver;
|
|
149
|
+
declare class ScreenRecorder {
|
|
150
|
+
/**
|
|
151
|
+
* @param {string} udid
|
|
152
|
+
* @param {string} videoPath
|
|
153
|
+
* @param {import('@appium/types').AppiumLogger} log
|
|
154
|
+
* @param {{codec?: string, display?: string, mask?: string, timeLimit?: string|number}} [opts={}]
|
|
155
|
+
*/
|
|
156
|
+
constructor(udid: string, videoPath: string, log: import("@appium/types").AppiumLogger, opts?: {
|
|
157
|
+
codec?: string;
|
|
158
|
+
display?: string;
|
|
159
|
+
mask?: string;
|
|
160
|
+
timeLimit?: string | number;
|
|
161
|
+
});
|
|
162
|
+
log: import("@appium/types").AppiumLogger;
|
|
163
|
+
_process: import("teen_process").SubProcess | null;
|
|
164
|
+
_udid: string;
|
|
165
|
+
_videoPath: string;
|
|
166
|
+
_codec: string | undefined;
|
|
167
|
+
_display: string | undefined;
|
|
168
|
+
_mask: string | undefined;
|
|
169
|
+
_timeLimitMs: number;
|
|
170
|
+
_timer: NodeJS.Timeout | null;
|
|
171
|
+
getVideoPath(): Promise<string>;
|
|
172
|
+
get isRunning(): boolean;
|
|
173
|
+
_enforceTermination(): Promise<string>;
|
|
174
|
+
start(): Promise<void>;
|
|
175
|
+
stop(force?: boolean): Promise<string>;
|
|
120
176
|
}
|
|
177
|
+
export {};
|
|
121
178
|
//# sourceMappingURL=record-screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.js"],"names":[],"mappings":"AAsNA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,sFAJW,qBAAqB,iBA6C/B;;IAlED;;;;;;;;;;;;;OAaG;IAEH;;;;;;;;;OASG;IACH,6DAJW,qBAAqB,EA6C/B;IAxBC,gCAA2B;;AA0B7B;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;GAYG;AACH,qFARW,oBAAoB,GAClB,OAAO,CAAC,MAAM,CAAC,CAwB3B;;;;;WAjHa,MAAM;;;;aACN,MAAM;;;;;;;UACN,MAAM;;;;;eAIN,MAAM,GAAC,MAAM;;;;;kBAEb,OAAO;;;;;;;;;;;gBA4DP,MAAM;;;;UAMN,MAAM;;;;UACN,MAAM;;;;YACN,MAAM;;;;;;;;;mBAEN,MAAM;;;;gBAEN,MAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;;2BAoC1B,OAAO,WAAW,EAAE,YAAY;AA/R7C;IACE;;;;;OAKG;IACH,kBALW,MAAM,aACN,MAAM,OACN,OAAO,eAAe,EAAE,YAAY,SACpC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;KAAC,EAkBtF;IAfC,0CAAc;IACd,mDAAoB;IACpB,cAAiB;IACjB,mBAA2B;IAC3B,2BAAwB;IACxB,6BAA4B;IAC5B,0BAAsB;IACtB,qBAAyC;IAOzC,8BAAkB;IAGpB,gCAMC;IAED,yBAEC;IAED,uCAcC;IAED,uBA8DC;IAED,uCAuBC;CACF"}
|
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.startRecordingScreen = startRecordingScreen;
|
|
7
|
+
exports.stopRecordingScreen = stopRecordingScreen;
|
|
6
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
9
|
const support_1 = require("appium/support");
|
|
8
10
|
const asyncbox_1 = require("asyncbox");
|
|
9
11
|
const node_simctl_1 = require("node-simctl");
|
|
10
|
-
const commands = {};
|
|
11
12
|
const STARTUP_INTERVAL_MS = 300;
|
|
12
13
|
const STARTUP_TIMEOUT_MS = 10 * 1000;
|
|
13
14
|
const DEFAULT_TIME_LIMIT_MS = 60 * 10 * 1000; // 10 minutes
|
|
@@ -221,11 +222,12 @@ async function extractSimulatorUdid(caps) {
|
|
|
221
222
|
* This method uses `xcrun simctl io recordVideo` helper under the hood.
|
|
222
223
|
* Check the output of `xcrun simctl io` command for more details.
|
|
223
224
|
*
|
|
225
|
+
* @this {SafariDriver}
|
|
224
226
|
* @param {StartRecordingOptions} options - The available options.
|
|
225
227
|
* @this {import('../driver').SafariDriver}
|
|
226
228
|
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
|
|
227
229
|
*/
|
|
228
|
-
|
|
230
|
+
async function startRecordingScreen(options) {
|
|
229
231
|
const { timeLimit, codec, display, mask, forceRestart = true, } = options ?? {};
|
|
230
232
|
if (this._screenRecorder?.isRunning) {
|
|
231
233
|
this.log.info('The screen recording is already running');
|
|
@@ -259,7 +261,7 @@ commands.startRecordingScreen = async function startRecordingScreen(options) {
|
|
|
259
261
|
this._screenRecorder = null;
|
|
260
262
|
throw e;
|
|
261
263
|
}
|
|
262
|
-
}
|
|
264
|
+
}
|
|
263
265
|
/**
|
|
264
266
|
* @typedef {Object} StopRecordingOptions
|
|
265
267
|
*
|
|
@@ -281,6 +283,7 @@ commands.startRecordingScreen = async function startRecordingScreen(options) {
|
|
|
281
283
|
* Stop recording the screen.
|
|
282
284
|
* If no screen recording has been started before then the method returns an empty string.
|
|
283
285
|
*
|
|
286
|
+
* @this {SafariDriver}
|
|
284
287
|
* @param {StopRecordingOptions} options - The available options.
|
|
285
288
|
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
286
289
|
* parameter is falsy or an empty string.
|
|
@@ -289,7 +292,7 @@ commands.startRecordingScreen = async function startRecordingScreen(options) {
|
|
|
289
292
|
* or the file content cannot be uploaded to the remote location
|
|
290
293
|
* or screen recording is not supported on the device under test.
|
|
291
294
|
*/
|
|
292
|
-
|
|
295
|
+
async function stopRecordingScreen(options) {
|
|
293
296
|
if (!this._screenRecorder) {
|
|
294
297
|
this.log.info('No screen recording has been started. Doing nothing');
|
|
295
298
|
return '';
|
|
@@ -305,6 +308,8 @@ commands.stopRecordingScreen = async function stopRecordingScreen(options) {
|
|
|
305
308
|
this.log.debug(`The size of the resulting screen recording is ${support_1.util.toReadableSizeString(size)}`);
|
|
306
309
|
}
|
|
307
310
|
return await uploadRecordedMedia(videoPath, options?.remotePath, options);
|
|
308
|
-
}
|
|
309
|
-
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @typedef {import('../driver').SafariDriver} SafariDriver
|
|
314
|
+
*/
|
|
310
315
|
//# sourceMappingURL=record-screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.js","sourceRoot":"","sources":["../../../lib/commands/record-screen.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"record-screen.js","sourceRoot":"","sources":["../../../lib/commands/record-screen.js"],"names":[],"mappings":";;;;;AA+OA,oDAyCC;AAiCD,kDAiBC;AA1UD,oDAAuB;AACvB,4CAAwD;AACxD,uCAA4C;AAC5C,6CAAqC;AAErC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,MAAM,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAC3D,MAAM,2BAA2B,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9C,MAAM,WAAW,GAAG,MAAM,CAAC;AAE3B;;;;;;GAMG;AACH,KAAK,UAAU,mBAAmB,CAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,aAAa,GAAG,EAAE;IAClF,IAAI,g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CAAC,CAAC;QACrE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,gBAAC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;QACnC,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,YAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iDAAiD,cAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,MAAM,mBAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG"}
|
package/build/lib/driver.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export class SafariDriver extends BaseDriver<any, import("@appium/types").String
|
|
|
20
20
|
constructor(opts?: {});
|
|
21
21
|
/** @type {boolean} */
|
|
22
22
|
isProxyActive: boolean;
|
|
23
|
+
/** @type {SafariDriverServer} */
|
|
24
|
+
safari: SafariDriverServer;
|
|
23
25
|
desiredCapConstraints: {
|
|
24
26
|
browserName: {
|
|
25
27
|
isString: boolean;
|
|
@@ -59,7 +61,6 @@ export class SafariDriver extends BaseDriver<any, import("@appium/types").String
|
|
|
59
61
|
};
|
|
60
62
|
};
|
|
61
63
|
resetState(): void;
|
|
62
|
-
safari: SafariDriverServer | null | undefined;
|
|
63
64
|
proxyReqRes: any;
|
|
64
65
|
_screenRecorder: any;
|
|
65
66
|
proxyActive(): boolean;
|
|
@@ -67,8 +68,15 @@ export class SafariDriver extends BaseDriver<any, import("@appium/types").String
|
|
|
67
68
|
canProxy(): boolean;
|
|
68
69
|
createSession(...args: any[]): Promise<(string | import("@appium/types").DriverCaps<any>)[]>;
|
|
69
70
|
deleteSession(): Promise<void>;
|
|
71
|
+
deleteCookies: typeof cookieCommands.deleteCookies;
|
|
72
|
+
findElOrEls: typeof findCommands.findElOrEls;
|
|
73
|
+
startRecordingScreen: typeof recordScreenCommands.startRecordingScreen;
|
|
74
|
+
stopRecordingScreen: typeof recordScreenCommands.stopRecordingScreen;
|
|
70
75
|
}
|
|
71
76
|
export default SafariDriver;
|
|
72
77
|
import { BaseDriver } from 'appium/driver';
|
|
73
|
-
import SafariDriverServer from './safari';
|
|
78
|
+
import { SafariDriverServer } from './safari';
|
|
79
|
+
import * as cookieCommands from './commands/cookies';
|
|
80
|
+
import * as findCommands from './commands/find';
|
|
81
|
+
import * as recordScreenCommands from './commands/record-screen';
|
|
74
82
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":"AAmBA;IAOE;;;;;;;;;;;;;;;;;MAAmC;IAEnC,uBAeC;IAvBD,sBAAsB;IACtB,eADW,OAAO,CACJ;IAEd,iCAAiC;IACjC,QADW,kBAAkB,CACtB;IAOL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkD;IAcpD,mBAMC;IAHC,iBAAuB;IAEvB,qBAA2B;IAG7B,uBAEC;IAED,4DAEC;IAED,oBAEC;IAGD,6FAeC;IAED,+BAOC;IAED,mDAA6C;IAE7C,6CAAuC;IAEvC,uEAAiE;IACjE,qEAA+D;CAChE;;2BAlG0B,eAAe;mCACP,UAAU;gCAEb,oBAAoB;8BACtB,iBAAiB;sCACT,0BAA0B"}
|
package/build/lib/driver.js
CHANGED
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.SafariDriver = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
37
|
const driver_1 = require("appium/driver");
|
|
9
|
-
const safari_1 =
|
|
38
|
+
const safari_1 = require("./safari");
|
|
10
39
|
const desired_caps_1 = require("./desired-caps");
|
|
11
|
-
const
|
|
40
|
+
const cookieCommands = __importStar(require("./commands/cookies"));
|
|
41
|
+
const findCommands = __importStar(require("./commands/find"));
|
|
42
|
+
const recordScreenCommands = __importStar(require("./commands/record-screen"));
|
|
12
43
|
const utils_1 = require("./utils");
|
|
13
44
|
const method_map_1 = require("./method-map");
|
|
14
45
|
/** @type {import('@appium/types').RouteMatcher[]} */
|
|
@@ -23,6 +54,10 @@ class SafariDriver extends driver_1.BaseDriver {
|
|
|
23
54
|
constructor(opts = {}) {
|
|
24
55
|
// @ts-ignore TODO: make args typed
|
|
25
56
|
super(opts);
|
|
57
|
+
this.deleteCookies = cookieCommands.deleteCookies;
|
|
58
|
+
this.findElOrEls = findCommands.findElOrEls;
|
|
59
|
+
this.startRecordingScreen = recordScreenCommands.startRecordingScreen;
|
|
60
|
+
this.stopRecordingScreen = recordScreenCommands.stopRecordingScreen;
|
|
26
61
|
this.desiredCapConstraints = desired_caps_1.desiredCapConstraints;
|
|
27
62
|
this.locatorStrategies = [
|
|
28
63
|
'xpath',
|
|
@@ -35,11 +70,9 @@ class SafariDriver extends driver_1.BaseDriver {
|
|
|
35
70
|
'name',
|
|
36
71
|
];
|
|
37
72
|
this.resetState();
|
|
38
|
-
for (const [cmd, fn] of lodash_1.default.toPairs(index_1.commands)) {
|
|
39
|
-
SafariDriver.prototype[cmd] = fn;
|
|
40
|
-
}
|
|
41
73
|
}
|
|
42
74
|
resetState() {
|
|
75
|
+
// @ts-ignore That's ok
|
|
43
76
|
this.safari = null;
|
|
44
77
|
this.proxyReqRes = null;
|
|
45
78
|
this.isProxyActive = false;
|
|
@@ -58,9 +91,11 @@ class SafariDriver extends driver_1.BaseDriver {
|
|
|
58
91
|
async createSession(...args) {
|
|
59
92
|
// @ts-ignore TODO: make args typed
|
|
60
93
|
const [sessionId, caps] = await super.createSession(...args);
|
|
61
|
-
this.safari = new safari_1.
|
|
94
|
+
this.safari = new safari_1.SafariDriverServer(this.log);
|
|
62
95
|
try {
|
|
63
|
-
await this.safari.start((0, utils_1.formatCapsForServer)(caps)
|
|
96
|
+
await this.safari.start((0, utils_1.formatCapsForServer)(caps), {
|
|
97
|
+
reqBasePath: this.basePath,
|
|
98
|
+
});
|
|
64
99
|
}
|
|
65
100
|
catch (e) {
|
|
66
101
|
await this.deleteSession();
|
package/build/lib/driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2C;AAC3C,qCAA8C;AAC9C,iDAAuD;AACvD,mEAAqD;AACrD,8DAAgD;AAChD,+EAAiE;AACjE,mCAA8C;AAC9C,6CAA4C;AAE5C,qDAAqD;AACrD,MAAM,QAAQ,GAAG;IACf,CAAC,KAAK,EAAE,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC7C,CAAC,MAAM,EAAE,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC,MAAM,EAAE,IAAI,MAAM,CAAC,0CAA0C,CAAC,CAAC;IAChE,CAAC,MAAM,EAAE,IAAI,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAElD,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,yBAAyB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAa,YAAa,SAAQ,mBAAU;IAS1C,YAAa,IAAI,GAAG,EAAE;QACpB,mCAAmC;QACnC,KAAK,CAAC,IAAI,CAAC,CAAC;QA8Dd,kBAAa,GAAG,cAAc,CAAC,aA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,aAAa,EAAE,CAAC;YAC3B,MAAM,CAAC,CAAC;QACV,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;;AAvEH,oCA+EC;AAxEQ,yBAAY,GAAG,yBAAY,AAAf,CAAgB;AA0ErC,kBAAe,YAAY,CAAC"}
|
package/build/lib/safari.d.ts
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export class SafariDriverServer {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('@appium/types').AppiumLogger} log
|
|
4
|
+
*/
|
|
5
|
+
constructor(log: import("@appium/types").AppiumLogger);
|
|
6
|
+
/** @type {SafariProxy} */
|
|
7
|
+
proxy: SafariProxy;
|
|
8
|
+
log: import("@appium/types").AppiumLogger;
|
|
6
9
|
get isRunning(): boolean;
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {import('@appium/types').StringRecord} caps
|
|
13
|
+
* @param {SessionOptions} [opts={}]
|
|
14
|
+
*/
|
|
15
|
+
start(caps: import("@appium/types").StringRecord, opts?: SessionOptions): Promise<void>;
|
|
8
16
|
stop(): Promise<void>;
|
|
9
17
|
}
|
|
18
|
+
export default SafariDriverServer;
|
|
19
|
+
export type SessionOptions = {
|
|
20
|
+
reqBasePath?: string | undefined;
|
|
21
|
+
};
|
|
10
22
|
declare class SafariProxy extends JWProxy {
|
|
11
23
|
/** @type {boolean|undefined} */
|
|
12
24
|
didProcessExit: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safari.d.ts","sourceRoot":"","sources":["../../lib/safari.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safari.d.ts","sourceRoot":"","sources":["../../lib/safari.js"],"names":[],"mappings":"AAoGA;IAIE;;OAEG;IACH,iBAFW,OAAO,eAAe,EAAE,YAAY,EAM9C;IAVD,0BAA0B;IAC1B,OADW,WAAW,CAChB;IAMJ,0CAAc;IAKhB,yBAEC;IAED;;;;OAIG;IACH,YAHW,OAAO,eAAe,EAAE,YAAY,SACpC,cAAc,iBAyDxB;IAED,sBAaC;CACF;;;;;AA7KD;IACE,gCAAgC;IAChC,gBADW,OAAO,GAAC,SAAS,CACb;IAEf,+DAOC;CACF;wBA9B+B,eAAe"}
|