appium-safari-driver 4.0.2 → 4.1.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/.github/dependabot.yml +9 -0
- package/.github/workflows/functional-test.yml +1 -1
- package/.github/workflows/pr-title.yml +3 -9
- package/.github/workflows/publish.js.yml +1 -1
- package/.github/workflows/unit-test.yml +23 -14
- package/CHANGELOG.md +12 -0
- package/build/lib/commands/cookies.d.ts +5 -4
- package/build/lib/commands/cookies.d.ts.map +1 -1
- package/build/lib/commands/cookies.js +3 -5
- package/build/lib/commands/cookies.js.map +1 -1
- package/build/lib/commands/find.d.ts +9 -8
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +7 -10
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/record-screen.d.ts +68 -158
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +35 -75
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/desired-caps.d.ts +27 -25
- package/build/lib/desired-caps.d.ts.map +1 -1
- package/build/lib/desired-caps.js.map +1 -1
- package/build/lib/driver.d.ts +18 -54
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +19 -18
- package/build/lib/driver.js.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +1 -1
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +2 -2
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/safari.d.ts +15 -23
- package/build/lib/safari.d.ts.map +1 -1
- package/build/lib/safari.js +19 -27
- package/build/lib/safari.js.map +1 -1
- package/build/lib/utils.d.ts +3 -5
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +0 -1
- package/build/lib/utils.js.map +1 -1
- package/build/test/functional/desktop-driver-e2e-specs.d.ts +2 -0
- package/build/test/functional/desktop-driver-e2e-specs.d.ts.map +1 -0
- package/build/test/functional/desktop-driver-e2e-specs.js +69 -0
- package/build/test/functional/desktop-driver-e2e-specs.js.map +1 -0
- package/build/test/functional/mobile-driver-e2e-specs.d.ts +2 -0
- package/build/test/functional/mobile-driver-e2e-specs.d.ts.map +1 -0
- package/build/test/functional/mobile-driver-e2e-specs.js +95 -0
- package/build/test/functional/mobile-driver-e2e-specs.js.map +1 -0
- package/build/test/unit/driver-specs.d.ts +2 -0
- package/build/test/unit/driver-specs.d.ts.map +1 -0
- package/build/test/unit/driver-specs.js +10 -0
- package/build/test/unit/driver-specs.js.map +1 -0
- package/build/test/unit/utils-specs.d.ts +2 -0
- package/build/test/unit/utils-specs.d.ts.map +1 -0
- package/build/test/unit/utils-specs.js +43 -0
- package/build/test/unit/utils-specs.js.map +1 -0
- package/build/test/utils.d.ts +4 -0
- package/build/test/utils.d.ts.map +1 -0
- package/build/test/utils.js +7 -0
- package/build/test/utils.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/cookies.ts +11 -0
- package/lib/commands/find.ts +27 -0
- package/lib/commands/{record-screen.js → record-screen.ts} +118 -90
- package/lib/{desired-caps.js → desired-caps.ts} +6 -1
- package/lib/{driver.js → driver.ts} +49 -28
- package/lib/{logger.js → logger.ts} +1 -0
- package/lib/{method-map.js → method-map.ts} +6 -2
- package/lib/{safari.js → safari.ts} +46 -42
- package/lib/{utils.js → utils.ts} +5 -4
- package/npm-shrinkwrap.json +275 -823
- package/package.json +3 -3
- package/test/functional/{desktop-driver-e2e-specs.js → desktop-driver-e2e-specs.ts} +8 -13
- package/test/functional/{mobile-driver-e2e-specs.js → mobile-driver-e2e-specs.ts} +10 -12
- package/test/unit/driver-specs.ts +9 -0
- package/test/unit/{utils-specs.js → utils-specs.ts} +5 -10
- package/test/utils.ts +4 -0
- package/tsconfig.json +3 -2
- package/lib/commands/cookies.js +0 -12
- package/lib/commands/find.js +0 -23
- package/test/unit/driver-specs.js +0 -15
- package/test/utils.js +0 -5
package/.github/dependabot.yml
CHANGED
|
@@ -9,3 +9,12 @@ updates:
|
|
|
9
9
|
commit-message:
|
|
10
10
|
prefix: "chore"
|
|
11
11
|
include: "scope"
|
|
12
|
+
- package-ecosystem: "github-actions"
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: daily
|
|
16
|
+
time: "11:00"
|
|
17
|
+
open-pull-requests-limit: 10
|
|
18
|
+
commit-message:
|
|
19
|
+
prefix: "chore"
|
|
20
|
+
include: "scope"
|
|
@@ -3,14 +3,8 @@ on:
|
|
|
3
3
|
pull_request:
|
|
4
4
|
types: [opened, edited, synchronize, reopened]
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
jobs:
|
|
8
7
|
lint:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- uses: beemojs/conventional-pr-action@v3
|
|
13
|
-
with:
|
|
14
|
-
config-preset: angular
|
|
15
|
-
env:
|
|
16
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
8
|
+
uses: appium/appium-workflows/.github/workflows/pr-title.yml@main
|
|
9
|
+
with:
|
|
10
|
+
config-preset: angular
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
name: Unit Tests
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- 'docs/**'
|
|
8
|
+
- '*.md'
|
|
9
|
+
push:
|
|
10
|
+
branches: [ master ]
|
|
11
|
+
paths-ignore:
|
|
12
|
+
- 'docs/**'
|
|
13
|
+
- '*.md'
|
|
4
14
|
|
|
5
15
|
|
|
6
16
|
jobs:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
outputs:
|
|
10
|
-
versions: ${{ steps.generate-matrix.outputs.lts }}
|
|
11
|
-
steps:
|
|
12
|
-
- name: Select LTS versions of Node.js
|
|
13
|
-
id: generate-matrix
|
|
14
|
-
uses: msimerson/node-lts-versions@v1
|
|
17
|
+
node_matrix:
|
|
18
|
+
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
|
|
15
19
|
|
|
16
20
|
test:
|
|
17
21
|
needs:
|
|
18
|
-
-
|
|
22
|
+
- node_matrix
|
|
19
23
|
strategy:
|
|
24
|
+
fail-fast: false
|
|
20
25
|
matrix:
|
|
21
|
-
node-version: ${{ fromJSON(needs.
|
|
26
|
+
node-version: ${{ fromJSON(needs.node_matrix.outputs.versions) }}
|
|
22
27
|
runs-on: macos-latest
|
|
23
28
|
steps:
|
|
24
|
-
- uses: actions/checkout@
|
|
25
|
-
- uses: actions/setup-node@
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
- uses: actions/setup-node@v6
|
|
26
31
|
with:
|
|
27
32
|
node-version: ${{ matrix.node-version }}
|
|
28
|
-
|
|
33
|
+
check-latest: true
|
|
34
|
+
- uses: SocketDev/action@v1
|
|
35
|
+
with:
|
|
36
|
+
mode: firewall-free
|
|
37
|
+
- run: sfw npm install --no-package-lock
|
|
29
38
|
name: Install dev dependencies
|
|
30
39
|
- run: npm run lint
|
|
31
40
|
name: Run linter
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [4.1.1](https://github.com/appium/appium-safari-driver/compare/v4.1.0...v4.1.1) (2025-12-02)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* **deps:** bump actions/setup-node from 3 to 6 ([#150](https://github.com/appium/appium-safari-driver/issues/150)) ([6a6cffe](https://github.com/appium/appium-safari-driver/commit/6a6cffe5e0b622415329681176e3515d28cee933))
|
|
6
|
+
|
|
7
|
+
## [4.1.0](https://github.com/appium/appium-safari-driver/compare/v4.0.2...v4.1.0) (2025-11-25)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Migrate driver sources to typescript ([#148](https://github.com/appium/appium-safari-driver/issues/148)) ([c851874](https://github.com/appium/appium-safari-driver/commit/c8518746317289f5db9b27c30639a8b8b42778ae))
|
|
12
|
+
|
|
1
13
|
## [4.0.2](https://github.com/appium/appium-safari-driver/compare/v4.0.1...v4.0.2) (2025-11-15)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { SafariDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* Delete all cookies visible to the current page.
|
|
4
|
+
*
|
|
5
|
+
* @returns Promise that resolves when cookies are deleted
|
|
4
6
|
*/
|
|
5
|
-
export function deleteCookies(this:
|
|
6
|
-
export type SafariDriver = import("../driver").SafariDriver;
|
|
7
|
+
export declare function deleteCookies(this: SafariDriver): Promise<any>;
|
|
7
8
|
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/commands/cookies.
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/commands/cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,aAAa,CAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAErE"}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteCookies = deleteCookies;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Delete all cookies visible to the current page.
|
|
6
|
+
*
|
|
7
|
+
* @returns Promise that resolves when cookies are deleted
|
|
7
8
|
*/
|
|
8
9
|
async function deleteCookies() {
|
|
9
10
|
return await this.safari.proxy.command('/cookie', 'DELETE');
|
|
10
11
|
}
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {import('../driver').SafariDriver} SafariDriver
|
|
13
|
-
*/
|
|
14
12
|
//# sourceMappingURL=cookies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/commands/cookies.
|
|
1
|
+
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/commands/cookies.ts"],"names":[],"mappings":";;AAOA,sCAEC;AAPD;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { SafariDriver } from '../driver';
|
|
1
2
|
/**
|
|
3
|
+
* Find element(s) using the specified strategy and selector.
|
|
4
|
+
* This is needed to make lookup by image working.
|
|
2
5
|
*
|
|
3
|
-
* @
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
8
|
-
* @returns {Promise<any>}
|
|
6
|
+
* @param strategy - The locator strategy to use
|
|
7
|
+
* @param selector - The selector value
|
|
8
|
+
* @param mult - Whether to find multiple elements
|
|
9
|
+
* @param context - Optional context element ID
|
|
10
|
+
* @returns Promise that resolves to the found element(s)
|
|
9
11
|
*/
|
|
10
|
-
export function findElOrEls(this:
|
|
11
|
-
export type SafariDriver = import("../driver").SafariDriver;
|
|
12
|
+
export declare function findElOrEls(this: SafariDriver, strategy: string, selector: string, mult: boolean, context?: string): Promise<any>;
|
|
12
13
|
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,GAAG,CAAC,CAMd"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findElOrEls = findElOrEls;
|
|
4
4
|
const support_1 = require("appium/support");
|
|
5
|
-
// This is needed to make lookup by image working
|
|
6
5
|
/**
|
|
6
|
+
* Find element(s) using the specified strategy and selector.
|
|
7
|
+
* This is needed to make lookup by image working.
|
|
7
8
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @
|
|
13
|
-
* @returns {Promise<any>}
|
|
9
|
+
* @param strategy - The locator strategy to use
|
|
10
|
+
* @param selector - The selector value
|
|
11
|
+
* @param mult - Whether to find multiple elements
|
|
12
|
+
* @param context - Optional context element ID
|
|
13
|
+
* @returns Promise that resolves to the found element(s)
|
|
14
14
|
*/
|
|
15
15
|
async function findElOrEls(strategy, selector, mult, context) {
|
|
16
16
|
const endpoint = `/element${context ? `/${support_1.util.unwrapElement(context)}/element` : ''}${mult ? 's' : ''}`;
|
|
@@ -19,7 +19,4 @@ async function findElOrEls(strategy, selector, mult, context) {
|
|
|
19
19
|
value: selector,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* @typedef {import('../driver').SafariDriver} SafariDriver
|
|
24
|
-
*/
|
|
25
22
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":";;AAaA,kCAYC;AAzBD,4CAAsC;AAGtC;;;;;;;;;GASG;AACI,KAAK,UAAU,WAAW,CAE/B,QAAgB,EAChB,QAAgB,EAChB,IAAa,EACb,OAAgB;IAEhB,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"}
|
|
@@ -1,178 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* @property {string} mask - For non-rectangular displays, handle the mask by policy:
|
|
1
|
+
import type { AppiumLogger } from '@appium/types';
|
|
2
|
+
import type { SafariDriver } from '../driver';
|
|
3
|
+
interface ScreenRecorderOptions {
|
|
4
|
+
codec?: string;
|
|
5
|
+
display?: string;
|
|
6
|
+
mask?: string;
|
|
7
|
+
timeLimit?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export declare class ScreenRecorder {
|
|
10
|
+
private log;
|
|
11
|
+
private _process;
|
|
12
|
+
private _udid;
|
|
13
|
+
private _videoPath;
|
|
14
|
+
private _codec?;
|
|
15
|
+
private _display?;
|
|
16
|
+
private _mask?;
|
|
17
|
+
private _timeLimitMs;
|
|
18
|
+
private _timer;
|
|
19
|
+
constructor(udid: string, videoPath: string, log: AppiumLogger, opts?: ScreenRecorderOptions);
|
|
20
|
+
getVideoPath(): Promise<string>;
|
|
21
|
+
get isRunning(): boolean;
|
|
22
|
+
start(): Promise<void>;
|
|
23
|
+
stop(force?: boolean): Promise<string>;
|
|
24
|
+
private _enforceTermination;
|
|
25
|
+
}
|
|
26
|
+
export interface StartRecordingOptions {
|
|
27
|
+
/** Specifies the codec type: "h264" or "hevc" */
|
|
28
|
+
codec?: string;
|
|
29
|
+
/** Supports "internal" or "external". Default is "internal" */
|
|
30
|
+
display?: string;
|
|
31
|
+
/** For non-rectangular displays, handle the mask by policy:
|
|
33
32
|
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
|
|
34
33
|
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
|
|
35
34
|
* - 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
35
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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.
|
|
36
|
+
mask?: string;
|
|
37
|
+
/** The maximum recording time, in seconds. The default value is 600 seconds (10 minutes). */
|
|
38
|
+
timeLimit?: string | number;
|
|
39
|
+
/** Whether to ignore the call if a screen recording is currently running
|
|
40
|
+
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
|
|
50
41
|
*/
|
|
51
|
-
|
|
52
|
-
_screenRecorder: ScreenRecorder;
|
|
42
|
+
forceRestart?: boolean;
|
|
53
43
|
}
|
|
54
44
|
/**
|
|
55
|
-
*
|
|
45
|
+
* Record the Simulator's display in background while the automated test is running.
|
|
46
|
+
* This method uses `xcrun simctl io recordVideo` helper under the hood.
|
|
47
|
+
* Check the output of `xcrun simctl io` command for more details.
|
|
56
48
|
*
|
|
57
|
-
* @
|
|
58
|
-
*
|
|
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
|
|
49
|
+
* @param options - The available options.
|
|
50
|
+
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
|
|
70
51
|
*/
|
|
52
|
+
export declare function startRecordingScreen(this: SafariDriver, options?: StartRecordingOptions): Promise<void>;
|
|
53
|
+
export interface StopRecordingOptions {
|
|
54
|
+
/** The path to the remote location, where the resulting video should be uploaded.
|
|
55
|
+
* The following protocols are supported: http/https, ftp.
|
|
56
|
+
* Null or empty string value (the default setting) means the content of resulting
|
|
57
|
+
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
58
|
+
* An exception will be thrown if the generated media file is too big to
|
|
59
|
+
* fit into the available process memory.
|
|
60
|
+
*/
|
|
61
|
+
remotePath?: string;
|
|
62
|
+
/** The name of the user for the remote authentication. */
|
|
63
|
+
user?: string;
|
|
64
|
+
/** The password for the remote authentication. */
|
|
65
|
+
pass?: string;
|
|
66
|
+
/** The http multipart upload method name. The 'PUT' one is used by default. */
|
|
67
|
+
method?: string;
|
|
68
|
+
/** Additional headers mapping for multipart http(s) uploads */
|
|
69
|
+
headers?: Record<string, string>;
|
|
70
|
+
/** The name of the form field, where the file content BLOB should be stored for http(s) uploads */
|
|
71
|
+
fileFieldName?: string;
|
|
72
|
+
/** Additional form fields for multipart http(s) uploads */
|
|
73
|
+
formFields?: Record<string, string> | Array<[string, string]>;
|
|
74
|
+
}
|
|
71
75
|
/**
|
|
72
76
|
* Stop recording the screen.
|
|
73
77
|
* If no screen recording has been started before then the method returns an empty string.
|
|
74
78
|
*
|
|
75
|
-
* @
|
|
76
|
-
* @
|
|
77
|
-
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
79
|
+
* @param options - The available options.
|
|
80
|
+
* @returns Base64-encoded content of the recorded media file if 'remotePath'
|
|
78
81
|
* parameter is falsy or an empty string.
|
|
79
|
-
* @this {import('../driver').SafariDriver}
|
|
80
82
|
* @throws {Error} If there was an error while getting the name of a media file
|
|
81
83
|
* or the file content cannot be uploaded to the remote location
|
|
82
84
|
* or screen recording is not supported on the device under test.
|
|
83
85
|
*/
|
|
84
|
-
export function stopRecordingScreen(this:
|
|
85
|
-
export type StartRecordingOptions = {
|
|
86
|
-
/**
|
|
87
|
-
* [hevc] - Specifies the codec type: "h264" or "hevc"
|
|
88
|
-
*/
|
|
89
|
-
codec: string;
|
|
90
|
-
/**
|
|
91
|
-
* [internal] - Supports "internal" or "external". Default is "internal"
|
|
92
|
-
*/
|
|
93
|
-
display: string;
|
|
94
|
-
/**
|
|
95
|
-
* - For non-rectangular displays, handle the mask by policy:
|
|
96
|
-
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
|
|
97
|
-
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
|
|
98
|
-
* - black: The mask is rendered black.
|
|
99
|
-
*/
|
|
100
|
-
mask: string;
|
|
101
|
-
/**
|
|
102
|
-
* [600] - The maximum recording time, in seconds. The default
|
|
103
|
-
* value is 600 seconds (10 minutes).
|
|
104
|
-
*/
|
|
105
|
-
timeLimit: string | number;
|
|
106
|
-
/**
|
|
107
|
-
* [true] - Whether to ignore the call if a screen recording is currently running
|
|
108
|
-
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
|
|
109
|
-
*/
|
|
110
|
-
forceRestart: boolean;
|
|
111
|
-
};
|
|
112
|
-
export type StopRecordingOptions = {
|
|
113
|
-
/**
|
|
114
|
-
* - The path to the remote location, where the resulting video should be uploaded.
|
|
115
|
-
* The following protocols are supported: http/https, ftp.
|
|
116
|
-
* Null or empty string value (the default setting) means the content of resulting
|
|
117
|
-
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
118
|
-
* An exception will be thrown if the generated media file is too big to
|
|
119
|
-
* fit into the available process memory.
|
|
120
|
-
*/
|
|
121
|
-
remotePath: string;
|
|
122
|
-
/**
|
|
123
|
-
* - The name of the user for the remote authentication.
|
|
124
|
-
*/
|
|
125
|
-
user: string;
|
|
126
|
-
/**
|
|
127
|
-
* - The password for the remote authentication.
|
|
128
|
-
*/
|
|
129
|
-
pass: string;
|
|
130
|
-
/**
|
|
131
|
-
* - The http multipart upload method name. The 'PUT' one is used by default.
|
|
132
|
-
*/
|
|
133
|
-
method: string;
|
|
134
|
-
/**
|
|
135
|
-
* - Additional headers mapping for multipart http(s) uploads
|
|
136
|
-
*/
|
|
137
|
-
headers: any;
|
|
138
|
-
/**
|
|
139
|
-
* [file] - The name of the form field, where the file content BLOB should be stored for
|
|
140
|
-
* http(s) uploads
|
|
141
|
-
*/
|
|
142
|
-
fileFieldName: string;
|
|
143
|
-
/**
|
|
144
|
-
* - Additional form fields for multipart http(s) uploads
|
|
145
|
-
*/
|
|
146
|
-
formFields: any | [string, string][];
|
|
147
|
-
};
|
|
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: any;
|
|
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>;
|
|
176
|
-
}
|
|
86
|
+
export declare function stopRecordingScreen(this: SafariDriver, options?: StopRecordingOptions): Promise<string>;
|
|
177
87
|
export {};
|
|
178
88
|
//# sourceMappingURL=record-screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.
|
|
1
|
+
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiD9C,UAAU,qBAAqB;IAC7B,KAAK,CA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