@e2e-dev/revyl 0.0.2-nightly-20261124030219 → 0.0.2
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/dist/.build.json +1 -1
- package/dist/provider.d.ts +6 -3
- package/dist/provider.js +12 -11
- package/package.json +5 -5
package/dist/.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.0.2
|
|
1
|
+
{"version":"0.0.2"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Revyl's hosted iOS simulators and Android emulators as a `DeviceProvider`
|
|
3
3
|
* for the mobile engine, through agent-device's `@agent-device/revyl` plugin:
|
|
4
4
|
* each lease comes from its own agent-device daemon, which starts a Revyl
|
|
5
|
-
* device with the app installed from an `https` URL
|
|
5
|
+
* device with the app installed from an `https` URL, or with no app and
|
|
6
|
+
* then the target's local `app.appPath` installed on it.
|
|
6
7
|
*/
|
|
7
8
|
import type { DeviceProvider } from '@e2e-dev/mobile';
|
|
8
9
|
/** What `revyl()` takes: the build Revyl installs, and the device model it runs on. */
|
|
@@ -10,9 +11,11 @@ export interface RevylOptions {
|
|
|
10
11
|
/**
|
|
11
12
|
* `https` URL Revyl downloads the build from when it starts each device: an
|
|
12
13
|
* iOS simulator build (`.app` zipped) or an Android `.apk`. A local path is
|
|
13
|
-
* refused, since Revyl cannot read it
|
|
14
|
+
* refused, since Revyl cannot read it; name a local build with the target's
|
|
15
|
+
* `app.appPath` instead. Absent, the device starts with no app, and the
|
|
16
|
+
* target's `app.appPath`, when it has one, is installed on it.
|
|
14
17
|
*/
|
|
15
|
-
readonly app
|
|
18
|
+
readonly app?: string | undefined;
|
|
16
19
|
/** Device model as Revyl lists it: `iPhone 17 Pro Max`, `Pixel 7`. */
|
|
17
20
|
readonly device: string;
|
|
18
21
|
/** OS version as Revyl lists it for that model: `iOS 27.0`, `Android 14`. Absent, Revyl's default for the model. */
|
package/dist/provider.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Revyl's hosted iOS simulators and Android emulators as a `DeviceProvider`
|
|
3
3
|
* for the mobile engine, through agent-device's `@agent-device/revyl` plugin:
|
|
4
4
|
* each lease comes from its own agent-device daemon, which starts a Revyl
|
|
5
|
-
* device with the app installed from an `https` URL
|
|
5
|
+
* device with the app installed from an `https` URL, or with no app and
|
|
6
|
+
* then the target's local `app.appPath` installed on it.
|
|
6
7
|
*/
|
|
7
8
|
import { agentDeviceLeases, agentDevicePlugin } from '@e2e-dev/mobile/lease';
|
|
8
9
|
import { ConfigurationError, rejectUnknownKeys } from 'e2e/engine';
|
|
@@ -24,32 +25,31 @@ const OPTION_KEYS = Object.keys({
|
|
|
24
25
|
*/
|
|
25
26
|
export function revyl(options) {
|
|
26
27
|
rejectUnknownKeys('revyl()', options, OPTION_KEYS);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
throw new ConfigurationError('INVALID_CONFIG', `revyl: \`${key}\` is required, as a non-empty string`);
|
|
31
|
-
}
|
|
28
|
+
const device = options.device;
|
|
29
|
+
if (typeof device !== 'string' || device.trim() === '') {
|
|
30
|
+
throw new ConfigurationError('INVALID_CONFIG', 'revyl: `device` is required, as a non-empty string');
|
|
32
31
|
}
|
|
33
32
|
const osVersion = options.osVersion;
|
|
34
33
|
if (osVersion !== undefined && (typeof osVersion !== 'string' || osVersion.trim() === '')) {
|
|
35
34
|
throw new ConfigurationError('INVALID_CONFIG', 'revyl: `osVersion` must be a non-empty string');
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
const app = options.app;
|
|
37
|
+
if (app !== undefined && (typeof app !== 'string' || !isHttpsUrl(app))) {
|
|
38
38
|
// The value is left out: a rejected URL can carry credentials or a presigned signature.
|
|
39
39
|
throw new ConfigurationError('INVALID_CONFIG', 'revyl: `app` must be an https URL, without credentials, that Revyl can download the build from');
|
|
40
40
|
}
|
|
41
|
-
const { app, device } = options;
|
|
42
41
|
const leases = agentDeviceLeases({ provider: PROVIDER, label: 'Revyl' });
|
|
43
42
|
return {
|
|
44
43
|
name: PROVIDER,
|
|
45
44
|
async acquire(request) {
|
|
46
45
|
plugin.assertVersion(request.agentDeviceVersion);
|
|
47
|
-
if (request.appPath !== undefined)
|
|
48
|
-
throw new Error("Revyl installs the app from `app`; leave the target's `app.appPath` out");
|
|
46
|
+
if (request.appPath !== undefined && app !== undefined) {
|
|
47
|
+
throw new Error("Revyl installs the app from `app`; leave the target's `app.appPath` out, or leave `app` out to install that build instead");
|
|
48
|
+
}
|
|
49
49
|
const credentials = revylCredentials(request.env);
|
|
50
50
|
const selectors = {
|
|
51
51
|
device,
|
|
52
|
-
providerApp: app,
|
|
52
|
+
...(app === undefined ? {} : { providerApp: app }),
|
|
53
53
|
...(options.osVersion === undefined ? {} : { providerOsVersion: options.osVersion }),
|
|
54
54
|
};
|
|
55
55
|
return leases.acquire(request, {
|
|
@@ -57,6 +57,7 @@ export function revyl(options) {
|
|
|
57
57
|
selectors,
|
|
58
58
|
summary: `${device}, ${options.osVersion ?? request.platform}; Revyl device started`,
|
|
59
59
|
prepareHome: plugin.prepareHome,
|
|
60
|
+
installAppPath: true,
|
|
60
61
|
});
|
|
61
62
|
},
|
|
62
63
|
release: (lease, context) => leases.release(lease, context),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e2e-dev/revyl",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Revyl for e2e: hosted iOS simulators and Android emulators for mobile tests",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"e2e",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"NOTICE"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@e2e-dev/mobile": "0.12.9
|
|
48
|
-
"e2e": "0.
|
|
47
|
+
"@e2e-dev/mobile": ">=0.12.9 <1",
|
|
48
|
+
"e2e": ">=0.15.0 <1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@e2e-dev/mobile": "0.12.9
|
|
51
|
+
"@e2e-dev/mobile": "0.12.9",
|
|
52
52
|
"@types/node": "26.6.6",
|
|
53
|
-
"e2e": "0.25.0
|
|
53
|
+
"e2e": "0.25.0",
|
|
54
54
|
"typescript": "7.0.2",
|
|
55
55
|
"vitest": "5.1.1"
|
|
56
56
|
},
|