appium-mac2-driver 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +81 -2
- package/WebDriverAgentMac/IntegrationTests/AMVideoRecordingTests.m +57 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/AMVideoCommands.h +27 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/AMVideoCommands.m +120 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBDebugCommands.m +17 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBScreenshotCommands.m +8 -8
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/AMXCTRunnerDaemonSession.h +31 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/AMXCTRunnerDaemonSessionWrapper.h +39 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/AMXCTRunnerDaemonSessionWrapper.m +43 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingContainer.h +59 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingContainer.m +74 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingPromise.h +34 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingPromise.m +32 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingRequest.h +44 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBScreenRecordingRequest.m +97 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBSession.m +14 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.h +49 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.m +49 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMVideoRecorder.h +50 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMVideoRecorder.m +112 -0
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +64 -0
- package/build/lib/commands/helpers.d.ts +4 -0
- package/build/lib/commands/helpers.d.ts.map +1 -0
- package/build/lib/commands/helpers.js +28 -0
- package/build/lib/commands/helpers.js.map +1 -0
- package/build/lib/commands/native-record-screen.d.ts +75 -0
- package/build/lib/commands/native-record-screen.d.ts.map +1 -0
- package/build/lib/commands/native-record-screen.js +139 -0
- package/build/lib/commands/native-record-screen.js.map +1 -0
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +2 -28
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/driver.d.ts +25 -0
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +13 -0
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +18 -0
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +30 -0
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/helpers.ts +30 -0
- package/lib/commands/native-record-screen.ts +180 -0
- package/lib/commands/record-screen.js +2 -30
- package/lib/driver.js +18 -0
- package/lib/execute-method-map.ts +30 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
3
|
+
export declare function uploadRecordedMedia(this: Mac2Driver, localFile: string, remotePath: string | null, uploadOptions?: StringRecord): Promise<string>;
|
|
4
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../lib/commands/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,aAAa,GAAE,YAAiB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.uploadRecordedMedia = uploadRecordedMedia;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const support_1 = require("appium/support");
|
|
9
|
+
async function uploadRecordedMedia(localFile, remotePath, uploadOptions = {}) {
|
|
10
|
+
if (lodash_1.default.isEmpty(remotePath) || lodash_1.default.isNil(remotePath)) {
|
|
11
|
+
const { size } = await support_1.fs.stat(localFile);
|
|
12
|
+
this.log.debug(`The size of the resulting screen recording is ${support_1.util.toReadableSizeString(size)}`);
|
|
13
|
+
return (await support_1.util.toInMemoryBase64(localFile)).toString();
|
|
14
|
+
}
|
|
15
|
+
const { user, pass, method, headers, fileFieldName, formFields } = uploadOptions;
|
|
16
|
+
const options = {
|
|
17
|
+
method: method || 'PUT',
|
|
18
|
+
headers,
|
|
19
|
+
fileFieldName,
|
|
20
|
+
formFields,
|
|
21
|
+
};
|
|
22
|
+
if (user && pass) {
|
|
23
|
+
options.auth = { user, pass };
|
|
24
|
+
}
|
|
25
|
+
await support_1.net.uploadFile(localFile, remotePath, options);
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../lib/commands/helpers.ts"],"names":[],"mappings":";;;;;AAKA,kDAwBC;AA7BD,oDAAuB;AACvB,4CAA+C;AAIxC,KAAK,UAAU,mBAAmB,CAEvC,SAAiB,EACjB,UAAyB,EACzB,gBAA8B,EAAE;IAEhC,IAAI,gBAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,gBAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QACjD,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;QACnG,OAAO,CAAC,MAAM,cAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7D,CAAC;IAED,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAC,GAAG,aAAa,CAAC;IAC/E,MAAM,OAAO,GAAiB;QAC5B,MAAM,EAAE,MAAM,IAAI,KAAK;QACvB,OAAO;QACP,aAAa;QACb,UAAU;KACX,CAAC;IACF,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,GAAG,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC;IAC9B,CAAC;IACD,MAAM,aAAG,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
3
|
+
/**
|
|
4
|
+
* Initiates a new native screen recording session via XCTest.
|
|
5
|
+
* If the screen recording is already running then this call results in noop.
|
|
6
|
+
* A screen recording is running until a testing session is finished.
|
|
7
|
+
* If a recording has never been stopped explicitly during a test session
|
|
8
|
+
* then it would be stopped automatically upon test session termination,
|
|
9
|
+
* and leftover videos would be deleted as well.
|
|
10
|
+
*
|
|
11
|
+
* @since Xcode 15
|
|
12
|
+
* @param fps Frame Per Second setting for the resulting screen recording. 24 by default.
|
|
13
|
+
* @param codec Possible codec value, where `0` means H264 (the default setting), `1` means HEVC
|
|
14
|
+
* @param displayId Valid display identifier to record the video from. Main display is assumed
|
|
15
|
+
* by default.
|
|
16
|
+
* @returns The information about the asynchronously running video recording.
|
|
17
|
+
*/
|
|
18
|
+
export declare function macosStartNativeScreenRecording(this: Mac2Driver, fps?: number, codec?: number, displayId?: number): Promise<ActiveVideoInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* @since Xcode 15
|
|
21
|
+
* @returns The information about the asynchronously running video recording or
|
|
22
|
+
* null if no native video recording has been started.
|
|
23
|
+
*/
|
|
24
|
+
export declare function macosGetNativeScreenRecordingInfo(this: Mac2Driver): Promise<ActiveVideoInfo | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Stops native screen recordind.
|
|
27
|
+
* If no screen recording has been started before then the method throws an exception.
|
|
28
|
+
*
|
|
29
|
+
* @since Xcode 15
|
|
30
|
+
* @param remotePath The path to the remote location, where the resulting video should be uploaded.
|
|
31
|
+
* The following protocols are supported: http/https, ftp.
|
|
32
|
+
* Null or empty string value (the default setting) means the content of resulting
|
|
33
|
+
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
34
|
+
* An exception will be thrown if the generated media file is too big to
|
|
35
|
+
* fit into the available process memory.
|
|
36
|
+
* @param user The name of the user for the remote authentication.
|
|
37
|
+
* @param pass The password for the remote authentication.
|
|
38
|
+
* @param method The http multipart upload method name. The 'PUT' one is used by default.
|
|
39
|
+
* @param headers Additional headers mapping for multipart http(s) uploads
|
|
40
|
+
* @param fileFieldName The name of the form field, where the file content BLOB should
|
|
41
|
+
* be stored for http(s) uploads
|
|
42
|
+
* @param formFields Additional form fields for multipart http(s) uploads
|
|
43
|
+
* @returns Base64-encoded content of the recorded media file if 'remotePath'
|
|
44
|
+
* parameter is falsy or an empty string.
|
|
45
|
+
* @throws {Error} If there was an error while getting the name of a media file
|
|
46
|
+
* or the file content cannot be uploaded to the remote location
|
|
47
|
+
* or screen recording is not supported on the device under test.
|
|
48
|
+
*/
|
|
49
|
+
export declare function macosStopNativeScreenRecording(this: Mac2Driver, remotePath?: string, user?: string, pass?: string, method?: string, headers?: StringRecord | [string, any][], fileFieldName?: string, formFields?: StringRecord | [string, string][]): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Deletes previously recorded videos with given ids.
|
|
52
|
+
* This call is safe and does not raise any errors.
|
|
53
|
+
*
|
|
54
|
+
* @param uuids One or more video UUIDs to be deleted
|
|
55
|
+
*/
|
|
56
|
+
export declare function cleanupNativeRecordedVideos(this: Mac2Driver, uuids: string | Set<string>): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Fetches information about available displays
|
|
59
|
+
*
|
|
60
|
+
* @returns A map where keys are display identifiers and values are display infos
|
|
61
|
+
*/
|
|
62
|
+
export declare function macosListDisplays(this: Mac2Driver): Promise<StringRecord<DisplayInfo>>;
|
|
63
|
+
interface ActiveVideoInfo {
|
|
64
|
+
fps: number;
|
|
65
|
+
codec: number;
|
|
66
|
+
displayId: number;
|
|
67
|
+
uuid: string;
|
|
68
|
+
startedAt: number;
|
|
69
|
+
}
|
|
70
|
+
interface DisplayInfo {
|
|
71
|
+
id: number;
|
|
72
|
+
isMain: boolean;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=native-record-screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/native-record-screen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,UAAU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|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.macosStartNativeScreenRecording = macosStartNativeScreenRecording;
|
|
7
|
+
exports.macosGetNativeScreenRecordingInfo = macosGetNativeScreenRecordingInfo;
|
|
8
|
+
exports.macosStopNativeScreenRecording = macosStopNativeScreenRecording;
|
|
9
|
+
exports.cleanupNativeRecordedVideos = cleanupNativeRecordedVideos;
|
|
10
|
+
exports.macosListDisplays = macosListDisplays;
|
|
11
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const support_1 = require("appium/support");
|
|
14
|
+
const helpers_1 = require("./helpers");
|
|
15
|
+
/**
|
|
16
|
+
* Initiates a new native screen recording session via XCTest.
|
|
17
|
+
* If the screen recording is already running then this call results in noop.
|
|
18
|
+
* A screen recording is running until a testing session is finished.
|
|
19
|
+
* If a recording has never been stopped explicitly during a test session
|
|
20
|
+
* then it would be stopped automatically upon test session termination,
|
|
21
|
+
* and leftover videos would be deleted as well.
|
|
22
|
+
*
|
|
23
|
+
* @since Xcode 15
|
|
24
|
+
* @param fps Frame Per Second setting for the resulting screen recording. 24 by default.
|
|
25
|
+
* @param codec Possible codec value, where `0` means H264 (the default setting), `1` means HEVC
|
|
26
|
+
* @param displayId Valid display identifier to record the video from. Main display is assumed
|
|
27
|
+
* by default.
|
|
28
|
+
* @returns The information about the asynchronously running video recording.
|
|
29
|
+
*/
|
|
30
|
+
async function macosStartNativeScreenRecording(fps, codec, displayId) {
|
|
31
|
+
const result = await this.wda.proxy.command('/wda/video/start', 'POST', {
|
|
32
|
+
fps,
|
|
33
|
+
codec,
|
|
34
|
+
displayId,
|
|
35
|
+
});
|
|
36
|
+
this._recordedVideoIds.add(result.uuid);
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @since Xcode 15
|
|
41
|
+
* @returns The information about the asynchronously running video recording or
|
|
42
|
+
* null if no native video recording has been started.
|
|
43
|
+
*/
|
|
44
|
+
async function macosGetNativeScreenRecordingInfo() {
|
|
45
|
+
return await this.wda.proxy.command('/wda/video', 'GET');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Stops native screen recordind.
|
|
49
|
+
* If no screen recording has been started before then the method throws an exception.
|
|
50
|
+
*
|
|
51
|
+
* @since Xcode 15
|
|
52
|
+
* @param remotePath The path to the remote location, where the resulting video should be uploaded.
|
|
53
|
+
* The following protocols are supported: http/https, ftp.
|
|
54
|
+
* Null or empty string value (the default setting) means the content of resulting
|
|
55
|
+
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
56
|
+
* An exception will be thrown if the generated media file is too big to
|
|
57
|
+
* fit into the available process memory.
|
|
58
|
+
* @param user The name of the user for the remote authentication.
|
|
59
|
+
* @param pass The password for the remote authentication.
|
|
60
|
+
* @param method The http multipart upload method name. The 'PUT' one is used by default.
|
|
61
|
+
* @param headers Additional headers mapping for multipart http(s) uploads
|
|
62
|
+
* @param fileFieldName The name of the form field, where the file content BLOB should
|
|
63
|
+
* be stored for http(s) uploads
|
|
64
|
+
* @param formFields Additional form fields for multipart http(s) uploads
|
|
65
|
+
* @returns Base64-encoded content of the recorded media file if 'remotePath'
|
|
66
|
+
* parameter is falsy or an empty string.
|
|
67
|
+
* @throws {Error} If there was an error while getting the name of a media file
|
|
68
|
+
* or the file content cannot be uploaded to the remote location
|
|
69
|
+
* or screen recording is not supported on the device under test.
|
|
70
|
+
*/
|
|
71
|
+
async function macosStopNativeScreenRecording(remotePath, user, pass, method, headers, fileFieldName, formFields) {
|
|
72
|
+
const response = (await this.wda.proxy.command('/wda/video/stop', 'POST', {}));
|
|
73
|
+
if (!response || !lodash_1.default.isPlainObject(response)) {
|
|
74
|
+
throw new Error('There is no active screen recording, thus nothing to stop. Did you start it before?');
|
|
75
|
+
}
|
|
76
|
+
const { uuid } = response;
|
|
77
|
+
const matchedVideoPath = lodash_1.default.first((await listAttachments()).filter((name) => name.endsWith(uuid)));
|
|
78
|
+
if (!matchedVideoPath) {
|
|
79
|
+
throw new Error(`The screen recording identified by ${uuid} has not been found. Is it accessible?`);
|
|
80
|
+
}
|
|
81
|
+
const options = {
|
|
82
|
+
user,
|
|
83
|
+
pass,
|
|
84
|
+
method,
|
|
85
|
+
headers,
|
|
86
|
+
fileFieldName,
|
|
87
|
+
formFields
|
|
88
|
+
};
|
|
89
|
+
const result = await helpers_1.uploadRecordedMedia.bind(this)(matchedVideoPath, remotePath, options);
|
|
90
|
+
await cleanupNativeRecordedVideos.bind(this)(uuid);
|
|
91
|
+
this._recordedVideoIds.delete(uuid);
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Deletes previously recorded videos with given ids.
|
|
96
|
+
* This call is safe and does not raise any errors.
|
|
97
|
+
*
|
|
98
|
+
* @param uuids One or more video UUIDs to be deleted
|
|
99
|
+
*/
|
|
100
|
+
async function cleanupNativeRecordedVideos(uuids) {
|
|
101
|
+
const attachments = await listAttachments();
|
|
102
|
+
if (lodash_1.default.isEmpty(attachments)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const tasks = attachments
|
|
106
|
+
.map((attachmentPath) => [node_path_1.default.basename(attachmentPath), attachmentPath])
|
|
107
|
+
.filter(([name,]) => lodash_1.default.isString(uuids) ? uuids === name : uuids.has(name))
|
|
108
|
+
.map(([, attachmentPath]) => support_1.fs.rimraf(attachmentPath));
|
|
109
|
+
if (lodash_1.default.isEmpty(tasks)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
await Promise.all(tasks);
|
|
114
|
+
this.log.debug(`Successfully deleted ${support_1.util.pluralize('leftover video recording', tasks.length, true)}`);
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
this.log.warn(`Could not cleanup some leftover video recordings: ${e.message}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Fetches information about available displays
|
|
122
|
+
*
|
|
123
|
+
* @returns A map where keys are display identifiers and values are display infos
|
|
124
|
+
*/
|
|
125
|
+
async function macosListDisplays() {
|
|
126
|
+
return await this.wda.proxy.command('/wda/displays/list', 'GET');
|
|
127
|
+
}
|
|
128
|
+
// #region Private functions
|
|
129
|
+
async function listAttachments() {
|
|
130
|
+
// The expected path looks like
|
|
131
|
+
// $HOME/Library/Daemon Containers/EFDD24BF-F856-411F-8954-CD5F0D6E6F3E/Data/Attachments/CAE7E5E2-5AC9-4D33-A47B-C491D644DE06
|
|
132
|
+
const deamonContainersRoot = node_path_1.default.resolve(process.env.HOME, 'Library', 'Daemon Containers');
|
|
133
|
+
return await support_1.fs.glob(`*/Data/Attachments/*`, {
|
|
134
|
+
cwd: deamonContainersRoot,
|
|
135
|
+
absolute: true,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// #endregion
|
|
139
|
+
//# sourceMappingURL=native-record-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-record-screen.js","sourceRoot":"","sources":["../../../lib/commands/native-record-screen.ts"],"names":[],"mappings":";;;;;AAsBA,0EAaC;AAOD,8EAIC;AA0BD,wEAwCC;AAQD,kEAuBC;AAOD,8CAEC;AAxJD,oDAAuB;AACvB,0DAA6B;AAC7B,4CAA0C;AAE1C,uCAAgD;AAGhD;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,+BAA+B,CAEnD,GAAY,EACZ,KAAc,EACd,SAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE;QACtE,GAAG;QACH,KAAK;QACL,SAAS;KACV,CAAoB,CAAC;IACtB,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAA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AC;IAClF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,iBAAiB;IACrC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,KAAK,CAA8B,CAAC;AAChG,CAAC;AAED,4BAA4B;AAE5B,KAAK,UAAU,eAAe;IAC5B,+BAA+B;IAC/B,6HAA6H;IAC7H,MAAM,oBAAoB,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAc,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC;IACtG,OAAO,MAAM,YAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE;QAC3C,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC;AAeD,aAAa"}
|
|
@@ -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":"AAgLA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qFA3BW,MAAM,GAAC,MAAM,cAGb,MAAM,GAAC,MAAM,gBAEb,MAAM,QAIN,MAAM,GAAC,MAAM,WAEb,WAAW,GAAC,WAAW,GAAC,UAAU,GAAC,QAAQ,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,QAAQ,GAAC,UAAU,kBAOtF,OAAO,kBAEP,OAAO,iBAEP,OAAO,iBAkDjB;;IAhFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,4DA3BW,MAAM,GAAC,MAAM,cAGb,MAAM,GAAC,MAAM,gBAEb,MAAM,QAIN,MAAM,GAAC,MAAM,WAEb,WAAW,GAAC,WAAW,GAAC,UAAU,GAAC,QAAQ,GAAC,MAAM,GAAC,QAAQ,GAAC,MAAM,GAAC,QAAQ,GAAC,UAAU,kBAOtF,OAAO,kBAEP,OAAO,iBAEP,OAAO,EAkDjB;IArBC,gCAA2B;;AAuB7B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uFAtBW,MAAM,SAMN,MAAM,SACN,MAAM,WACN,MAAM,YACN,OAAO,eAAe,EAAE,YAAY,GAAC,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,kBAEpD,MAAM,eAEN,OAAO,eAAe,EAAE,YAAY,GAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAErD,OAAO,CAAC,MAAM,CAAC,CAoC3B;yBAGY,OAAO,WAAW,EAAE,UAAU;;;cAM7B,MAAM,GAAC,MAAM;;;;;;;AAnS3B;IACE;;;;;OAKG;IACH,uBAJW,MAAM,OACN,OAAO,eAAe,EAAE,YAAY,QACpC,qBAAqB,EAe/B;IAZC,2CAAe;IACf,mBAA2B;IAC3B,4BAAoB;IACpB,aAA+D;IAC/D,2BAA8B;IAC9B,oCAAwC;IACxC,oCAAwC;IACxC,gBAA4C;IAC5C,iCAAoC;IACpC,mBAEsB;IAGxB,gCAEC;IAED,qBAEC;IAED,uCAaC;IAED,uBAmEC;IAED,oCA4BC;CACF;2BA3K0B,cAAc"}
|
|
@@ -10,6 +10,7 @@ const asyncbox_1 = require("asyncbox");
|
|
|
10
10
|
const support_1 = require("appium/support");
|
|
11
11
|
const teen_process_1 = require("teen_process");
|
|
12
12
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
13
|
+
const helpers_1 = require("./helpers");
|
|
13
14
|
const RETRY_PAUSE = 300;
|
|
14
15
|
const RETRY_TIMEOUT = 5000;
|
|
15
16
|
const DEFAULT_TIME_LIMIT = 60 * 10; // 10 minutes
|
|
@@ -18,33 +19,6 @@ const DEFAULT_EXT = 'mp4';
|
|
|
18
19
|
const FFMPEG_BINARY = 'ffmpeg';
|
|
19
20
|
const DEFAULT_FPS = 15;
|
|
20
21
|
const DEFAULT_PRESET = 'veryfast';
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @this {Mac2Driver}
|
|
24
|
-
* @param {string} localFile
|
|
25
|
-
* @param {string?} remotePath
|
|
26
|
-
* @param {import('@appium/types').StringRecord} [uploadOptions={}]
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
async function uploadRecordedMedia(localFile, remotePath = null, uploadOptions = {}) {
|
|
30
|
-
if (lodash_1.default.isEmpty(remotePath) || lodash_1.default.isNil(remotePath)) {
|
|
31
|
-
const { size } = await support_1.fs.stat(localFile);
|
|
32
|
-
this.log.debug(`The size of the resulting screen recording is ${support_1.util.toReadableSizeString(size)}`);
|
|
33
|
-
return (await support_1.util.toInMemoryBase64(localFile)).toString();
|
|
34
|
-
}
|
|
35
|
-
const { user, pass, method, headers, fileFieldName, formFields } = uploadOptions;
|
|
36
|
-
const options = {
|
|
37
|
-
method: method || 'PUT',
|
|
38
|
-
headers,
|
|
39
|
-
fileFieldName,
|
|
40
|
-
formFields,
|
|
41
|
-
};
|
|
42
|
-
if (user && pass) {
|
|
43
|
-
options.auth = { user, pass };
|
|
44
|
-
}
|
|
45
|
-
await support_1.net.uploadFile(localFile, remotePath, options);
|
|
46
|
-
return '';
|
|
47
|
-
}
|
|
48
22
|
/**
|
|
49
23
|
* @param {import('@appium/types').AppiumLogger} log
|
|
50
24
|
*/
|
|
@@ -309,7 +283,7 @@ async function stopRecordingScreen(remotePath, user, pass, method, headers, file
|
|
|
309
283
|
fileFieldName,
|
|
310
284
|
formFields
|
|
311
285
|
};
|
|
312
|
-
return await uploadRecordedMedia.bind(this)(videoPath, remotePath, options);
|
|
286
|
+
return await helpers_1.uploadRecordedMedia.bind(this)(videoPath, remotePath, options);
|
|
313
287
|
}
|
|
314
288
|
;
|
|
315
289
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.js","sourceRoot":"","sources":["../../../lib/commands/record-screen.js"],"names":[],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,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC;AAAA,CAAC;AAEF;;GAEG;AAEH;;;;;;;;;GASG"}
|
package/build/lib/driver.d.ts
CHANGED
|
@@ -172,12 +172,32 @@ export class Mac2Driver extends BaseDriver<any, import("@appium/types").StringRe
|
|
|
172
172
|
readonly optional: readonly ["remotePath", "user", "pass", "method", "headers", "fileFieldName", "formFields"];
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
|
+
readonly 'macos: startNativeScreenRecording': {
|
|
176
|
+
readonly command: "macosStartNativeScreenRecording";
|
|
177
|
+
readonly params: {
|
|
178
|
+
readonly optional: readonly ["fps", "codec", "displayId"];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
readonly 'macos: getNativeScreenRecordingInfo': {
|
|
182
|
+
readonly command: "macosGetNativeScreenRecordingInfo";
|
|
183
|
+
};
|
|
184
|
+
readonly 'macos: stopNativeScreenRecording': {
|
|
185
|
+
readonly command: "macosStopNativeScreenRecording";
|
|
186
|
+
readonly params: {
|
|
187
|
+
readonly optional: readonly ["remotePath", "user", "pass", "method", "headers", "fileFieldName", "formFields"];
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
readonly 'macos: listDisplays': {
|
|
191
|
+
readonly command: "macosListDisplays";
|
|
192
|
+
};
|
|
175
193
|
};
|
|
176
194
|
constructor(opts?: {});
|
|
177
195
|
/** @type {boolean} */
|
|
178
196
|
isProxyActive: boolean;
|
|
179
197
|
/** @type {import('./wda-mac').WDAMacServer} */
|
|
180
198
|
wda: import("./wda-mac").WDAMacServer;
|
|
199
|
+
/** @type {Set<string>} */
|
|
200
|
+
_recordedVideoIds: Set<string>;
|
|
181
201
|
desiredCapConstraints: {
|
|
182
202
|
systemPort: {
|
|
183
203
|
isNumber: boolean;
|
|
@@ -269,6 +289,10 @@ export class Mac2Driver extends BaseDriver<any, import("@appium/types").StringRe
|
|
|
269
289
|
macosDeepLink: typeof navigationCommands.macosDeepLink;
|
|
270
290
|
startRecordingScreen: typeof recordScreenCommands.startRecordingScreen;
|
|
271
291
|
stopRecordingScreen: typeof recordScreenCommands.stopRecordingScreen;
|
|
292
|
+
macosStartNativeScreenRecording: typeof nativeScreenRecordingCommands.macosStartNativeScreenRecording;
|
|
293
|
+
macosGetNativeScreenRecordingInfo: typeof nativeScreenRecordingCommands.macosGetNativeScreenRecordingInfo;
|
|
294
|
+
macosStopNativeScreenRecording: typeof nativeScreenRecordingCommands.macosStopNativeScreenRecording;
|
|
295
|
+
macosListDisplays: typeof nativeScreenRecordingCommands.macosListDisplays;
|
|
272
296
|
macosScreenshots: typeof screenshotCommands.macosScreenshots;
|
|
273
297
|
macosSource: typeof sourceCommands.macosSource;
|
|
274
298
|
}
|
|
@@ -282,6 +306,7 @@ import * as findCommands from './commands/find';
|
|
|
282
306
|
import * as gesturesCommands from './commands/gestures';
|
|
283
307
|
import * as navigationCommands from './commands/navigation';
|
|
284
308
|
import * as recordScreenCommands from './commands/record-screen';
|
|
309
|
+
import * as nativeScreenRecordingCommands from './commands/native-record-screen';
|
|
285
310
|
import * as screenshotCommands from './commands/screenshots';
|
|
286
311
|
import * as sourceCommands from './commands/source';
|
|
287
312
|
//# 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":"AA8BA;IAUE;;;;;;;;;;;;;;;;;MAAmC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2C;IAE3C,uBAqBC;IAjCD,sBAAsB;IACtB,eADW,OAAO,CACJ;IAEd,+CAA+C;IAC/C,KADW,OAAO,WAAW,EAAE,YAAY,CACvC;IAEJ,0BAA0B;IAC1B,mBADW,GAAG,CAAC,MAAM,CAAC,CACJ;IAQhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkD;IAiBlD,6BAAwE;IAG1E,yDAIC;IAED,mBAOC;IAJC,iBAAuB;IAGvB,qBAA2B;IAI7B,qCAEC;IAGD,0EAEC;IAED,oBAEC;IAED,mEAEC;IAGD,8BAEC;IAGD,kCAEC;IAGD,6FAwBC;IAED,+BAgCC;IAED,6DAAuD;IACvD,iEAA2D;IAC3D,mEAA6D;IAC7D,qEAA+D;IAE/D,sEAAgE;IAEhE,wCAAkC;IAElC,6CAAuC;IAEvC,qDAA+C;IAC/C,+CAAyC;IACzC,iDAA2C;IAC3C,+CAAyC;IACzC,yDAAmD;IACnD,+CAAyC;IACzC,2DAAqD;IACrD,6DAAuD;IACvD,2EAAqE;IACrE,6CAAuC;IACvC,6DAAuD;IACvD,2CAAqC;IACrC,uDAAiD;IACjD,6DAAuD;IACvD,2EAAqE;IAErE,uDAAiD;IAEjD,uEAAiE;IACjE,qEAA+D;IAE/D,sGAAgG;IAChG,0GAAoG;IACpG,oGAA8F;IAC9F,0EAAoE;IAEpE,6DAAuD;IAEvD,+CAAyC;CAC1C;;2BAjN0C,eAAe;+BAAf,eAAe;wCAGlB,2BAA2B;qCAC9B,wBAAwB;iCAC5B,oBAAoB;8BACvB,iBAAiB;kCACb,qBAAqB;oCACnB,uBAAuB;sCACrB,0BAA0B;+CAMjB,iCAAiC;oCAL5C,wBAAwB;gCAC5B,mBAAmB"}
|
package/build/lib/driver.js
CHANGED
|
@@ -53,6 +53,7 @@ const sourceCommands = __importStar(require("./commands/source"));
|
|
|
53
53
|
const logger_1 = __importDefault(require("./logger"));
|
|
54
54
|
const method_map_1 = require("./method-map");
|
|
55
55
|
const execute_method_map_1 = require("./execute-method-map");
|
|
56
|
+
const nativeScreenRecordingCommands = __importStar(require("./commands/native-record-screen"));
|
|
56
57
|
/** @type {import('@appium/types').RouteMatcher[]} */
|
|
57
58
|
const NO_PROXY = [
|
|
58
59
|
['GET', new RegExp('^/session/[^/]+/appium')],
|
|
@@ -93,6 +94,10 @@ class Mac2Driver extends driver_1.BaseDriver {
|
|
|
93
94
|
this.macosDeepLink = navigationCommands.macosDeepLink;
|
|
94
95
|
this.startRecordingScreen = recordScreenCommands.startRecordingScreen;
|
|
95
96
|
this.stopRecordingScreen = recordScreenCommands.stopRecordingScreen;
|
|
97
|
+
this.macosStartNativeScreenRecording = nativeScreenRecordingCommands.macosStartNativeScreenRecording;
|
|
98
|
+
this.macosGetNativeScreenRecordingInfo = nativeScreenRecordingCommands.macosGetNativeScreenRecordingInfo;
|
|
99
|
+
this.macosStopNativeScreenRecording = nativeScreenRecordingCommands.macosStopNativeScreenRecording;
|
|
100
|
+
this.macosListDisplays = nativeScreenRecordingCommands.macosListDisplays;
|
|
96
101
|
this.macosScreenshots = screenshotCommands.macosScreenshots;
|
|
97
102
|
this.macosSource = sourceCommands.macosSource;
|
|
98
103
|
this.desiredCapConstraints = desired_caps_1.desiredCapConstraints;
|
|
@@ -120,6 +125,7 @@ class Mac2Driver extends driver_1.BaseDriver {
|
|
|
120
125
|
this.wda = null;
|
|
121
126
|
this.proxyReqRes = null;
|
|
122
127
|
this.isProxyActive = false;
|
|
128
|
+
this._recordedVideoIds = new Set();
|
|
123
129
|
this._screenRecorder = null;
|
|
124
130
|
}
|
|
125
131
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -173,6 +179,13 @@ class Mac2Driver extends driver_1.BaseDriver {
|
|
|
173
179
|
}
|
|
174
180
|
async deleteSession() {
|
|
175
181
|
await this._screenRecorder?.stop(true);
|
|
182
|
+
if (!lodash_1.default.isEmpty(this._recordedVideoIds)) {
|
|
183
|
+
try {
|
|
184
|
+
await this.wda.proxy.command('/wda/video/stop', 'POST', {});
|
|
185
|
+
}
|
|
186
|
+
catch { }
|
|
187
|
+
await nativeScreenRecordingCommands.cleanupNativeRecordedVideos.bind(this)(this._recordedVideoIds);
|
|
188
|
+
}
|
|
176
189
|
await this.wda.stopSession();
|
|
177
190
|
if (this.opts.postrun) {
|
|
178
191
|
if (!lodash_1.default.isString(this.opts.postrun.command) && !lodash_1.default.isString(this.opts.postrun.script)) {
|
package/build/lib/driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,0CAA2D;AAC3D,wDAAuC;AACvC,iDAAuD;AACvD,kFAAoE;AACpE,4EAA8D;AAC9D,oEAAsD;AACtD,8DAAgD;AAChD,sEAAwD;AACxD,0EAA4D;AAC5D,+EAAiE;AACjE,2EAA6D;AAC7D,kEAAoD;AACpD,sDAA2B;AAC3B,6CAA4C;AAC5C,6DAAwD;
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,0CAA2D;AAC3D,wDAAuC;AACvC,iDAAuD;AACvD,kFAAoE;AACpE,4EAA8D;AAC9D,oEAAsD;AACtD,8DAAgD;AAChD,sEAAwD;AACxD,0EAA4D;AAC5D,+EAAiE;AACjE,2EAA6D;AAC7D,kEAAoD;AACpD,sDAA2B;AAC3B,6CAA4C;AAC5C,6DAAwD;AACxD,+FAAiF;AAEjF,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;I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C,aAAa,EAAE,CAAC;IAC9B,CAAC;;AA1IH,gCAoLC;AA1KQ,uBAAY,GAAG,yBAAY,AAAf,CAAgB;AAC5B,2BAAgB,GAAG,qCAAgB,AAAnB,CAAoB;AA2K7C,kBAAe,UAAU,CAAC"}
|
|
@@ -153,5 +153,23 @@ export declare const executeMethodMap: {
|
|
|
153
153
|
readonly optional: readonly ["remotePath", "user", "pass", "method", "headers", "fileFieldName", "formFields"];
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
|
+
readonly 'macos: startNativeScreenRecording': {
|
|
157
|
+
readonly command: "macosStartNativeScreenRecording";
|
|
158
|
+
readonly params: {
|
|
159
|
+
readonly optional: readonly ["fps", "codec", "displayId"];
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly 'macos: getNativeScreenRecordingInfo': {
|
|
163
|
+
readonly command: "macosGetNativeScreenRecordingInfo";
|
|
164
|
+
};
|
|
165
|
+
readonly 'macos: stopNativeScreenRecording': {
|
|
166
|
+
readonly command: "macosStopNativeScreenRecording";
|
|
167
|
+
readonly params: {
|
|
168
|
+
readonly optional: readonly ["remotePath", "user", "pass", "method", "headers", "fileFieldName", "formFields"];
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
readonly 'macos: listDisplays': {
|
|
172
|
+
readonly command: "macosListDisplays";
|
|
173
|
+
};
|
|
156
174
|
};
|
|
157
175
|
//# sourceMappingURL=execute-method-map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-method-map.d.ts","sourceRoot":"","sources":["../../lib/execute-method-map.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"execute-method-map.d.ts","sourceRoot":"","sources":["../../lib/execute-method-map.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Ua,CAAC"}
|
|
@@ -303,5 +303,35 @@ exports.executeMethodMap = {
|
|
|
303
303
|
],
|
|
304
304
|
},
|
|
305
305
|
},
|
|
306
|
+
'macos: startNativeScreenRecording': {
|
|
307
|
+
command: 'macosStartNativeScreenRecording',
|
|
308
|
+
params: {
|
|
309
|
+
optional: [
|
|
310
|
+
'fps',
|
|
311
|
+
'codec',
|
|
312
|
+
'displayId',
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
'macos: getNativeScreenRecordingInfo': {
|
|
317
|
+
command: 'macosGetNativeScreenRecordingInfo',
|
|
318
|
+
},
|
|
319
|
+
'macos: stopNativeScreenRecording': {
|
|
320
|
+
command: 'macosStopNativeScreenRecording',
|
|
321
|
+
params: {
|
|
322
|
+
optional: [
|
|
323
|
+
'remotePath',
|
|
324
|
+
'user',
|
|
325
|
+
'pass',
|
|
326
|
+
'method',
|
|
327
|
+
'headers',
|
|
328
|
+
'fileFieldName',
|
|
329
|
+
'formFields'
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
'macos: listDisplays': {
|
|
334
|
+
command: 'macosListDisplays',
|
|
335
|
+
},
|
|
306
336
|
};
|
|
307
337
|
//# sourceMappingURL=execute-method-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-method-map.js","sourceRoot":"","sources":["../../lib/execute-method-map.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAG;IAC9B,cAAc,EAAE;QACd,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,aAAa;QAC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BACZ,MAAM;gBACN,MAAM;gBACN,QAAQ;gBACR,SAAS;gBACT,eAAe;gBACf,YAAY;aACb;SACF;KACF;CACuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"execute-method-map.js","sourceRoot":"","sources":["../../lib/execute-method-map.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAG;IAC9B,cAAc,EAAE;QACd,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,QAAQ;gBACR,QAAQ;aACT;YACD,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;aACZ;YACD,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,UAAU;gBACV,kBAAkB;aACnB;SACF;KACF;IACD,mBAAmB,EAAE;QACnB,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,WAAW;gBACX,GAAG;gBACH,GAAG;gBACH,kBAAkB;aACnB;SACF;KACF;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,mBAAmB;QAC5B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oBAAoB;QAC7B,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,UAAU;gBACV,MAAM;aACP;SACF;KACF;IACD,6BAA6B,EAAE;QAC7B,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,UAAU;aACX;YACD,QAAQ,EAAE;gBACR,WAAW;gBACX,aAAa;gBACb,KAAK;gBACL,QAAQ;gBACR,eAAe;gBACf,eAAe;gBACf,cAAc;aACf;SACF;KACF;IACD,4BAA4B,EAAE;QAC5B,OAAO,EAAE,qBAAqB;QAC9B,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,YAAY;gBACZ,MAAM;gBACN,MAAM;gBACN,QAAQ;gBACR,SAAS;gBACT,eAAe;gBACf,YAAY;aACb;SACF;KACF;IACD,mCAAmC,EAAE;QACnC,OAAO,EAAE,iCAAiC;QAC1C,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK;gBACL,OAAO;gBACP,WAAW;aACZ;SACF;KACF;IACD,qCAAqC,EAAE;QACrC,OAAO,EAAE,mCAAmC;KAC7C;IACD,kCAAkC,EAAE;QAClC,OAAO,EAAE,gCAAgC;QACzC,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,YAAY;gBACZ,MAAM;gBACN,MAAM;gBACN,QAAQ;gBACR,SAAS;gBACT,eAAe;gBACf,YAAY;aACb;SACF;KACF;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,mBAAmB;KAC7B;CACuC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import { util, fs, net } from 'appium/support';
|
|
3
|
+
import type { Mac2Driver } from '../driver';
|
|
4
|
+
import type { StringRecord } from '@appium/types';
|
|
5
|
+
|
|
6
|
+
export async function uploadRecordedMedia (
|
|
7
|
+
this: Mac2Driver,
|
|
8
|
+
localFile: string,
|
|
9
|
+
remotePath: string | null,
|
|
10
|
+
uploadOptions: StringRecord = {}
|
|
11
|
+
): Promise<string> {
|
|
12
|
+
if (_.isEmpty(remotePath) || _.isNil(remotePath)) {
|
|
13
|
+
const {size} = await fs.stat(localFile);
|
|
14
|
+
this.log.debug(`The size of the resulting screen recording is ${util.toReadableSizeString(size)}`);
|
|
15
|
+
return (await util.toInMemoryBase64(localFile)).toString();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {user, pass, method, headers, fileFieldName, formFields} = uploadOptions;
|
|
19
|
+
const options: StringRecord = {
|
|
20
|
+
method: method || 'PUT',
|
|
21
|
+
headers,
|
|
22
|
+
fileFieldName,
|
|
23
|
+
formFields,
|
|
24
|
+
};
|
|
25
|
+
if (user && pass) {
|
|
26
|
+
options.auth = {user, pass};
|
|
27
|
+
}
|
|
28
|
+
await net.uploadFile(localFile, remotePath, options);
|
|
29
|
+
return '';
|
|
30
|
+
}
|