@revyl/verify 0.3.2 → 0.4.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/docs/web.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A web target opens your app in a Revyl cloud browser.
4
4
 
5
- Web is available to every organization. If `revyl app create --platform web` reports `Web is not enabled for this organization`, Revyl has turned Web off for your organization; email support@revyl.ai.
5
+ Web is available to every organization, including the Free plan.
6
6
 
7
7
  ```ts
8
8
  {
@@ -12,6 +12,19 @@ Web is available to every organization. If `revyl app create --platform web` rep
12
12
  }
13
13
  ```
14
14
 
15
+ ## Create the Web app
16
+
17
+ A web target opens a Web app in Revyl, so create one first and copy its id:
18
+
19
+ 1. **In the dashboard:** open [app.revyl.ai](https://app.revyl.ai), click **Create app**, keep **Web** selected, and enter your site's public HTTPS URL. Copy the app id from the app's page.
20
+ 2. **Or with the [Revyl CLI](https://github.com/RevylAI/revyl-cli#install):** `revyl app create --name "My Web App" --platform web` prints the app id.
21
+
22
+ Then scaffold a config with it, or put it in `app.appId` yourself:
23
+
24
+ ```bash
25
+ npx @revyl/verify init --platform web --app-id <app-id> --url https://example.com
26
+ ```
27
+
15
28
  ## What it opens
16
29
 
17
30
  - With `app.url`, each `open()` registers the URL as a build of the Revyl app (on `app.branch` when set) and opens it. The URL must be public HTTPS; Revyl's browser cannot reach `localhost` or a private network.
@@ -37,3 +50,45 @@ The default Revyl service is used for normal setup. Authenticate with a matching
37
50
  A Revyl backend that does not run steps on web yet answers with `step_output_not_available`, which Verify reports as `NOT_AVAILABLE_ON_PLATFORM`. The same script works there with no change once it does. `open`, `screenshot`, `viewerUrl`, and `close` work on web everywhere.
38
51
 
39
52
  Revyl runs one step at a time on a session. A step sent while another is still running, for example one that just timed out and is still being cancelled, fails with `SESSION_BUSY`.
53
+
54
+ ## Exact actions
55
+
56
+ **Since 0.4.0. Early access.** In TypeScript (`@revyl/verify` 0.4.0), Python (`revyl-verify` 0.2.0) and Go (v0.3.0); the [Python](https://github.com/RevylAI/verify/blob/v0.4.0/python/README.md#exact-actions) and [Go](https://github.com/RevylAI/verify/blob/v0.4.0/go/README.md#exact-actions) READMEs show them with each language's names. When you know exactly what to click, skip the agent. Exact actions run in the browser as given, with no model, and mix freely with `instruction()` and `validation()`:
57
+
58
+ ```ts
59
+ import { open } from '@revyl/verify';
60
+
61
+ const session = await open('web'); // https://www.saucedemo.com in examples/web-store
62
+ try {
63
+ await session.type({ target: 'Username field' }, 'standard_user'); // Revyl finds the element you describe
64
+ await session.type({ target: 'Password field' }, 'secret_sauce');
65
+ await session.pressKey('enter');
66
+ await session.validation('A list of products is shown');
67
+ await session.swipe('up'); // the finger moves up, so the page scrolls down
68
+ await session.instruction('Add the Sauce Labs Onesie to the cart'); // hand the fuzzy part to the agent
69
+ const cart = await session.locate('Shopping cart icon'); // where Revyl finds it, in CSS pixels
70
+ await session.tap(cart); // a tap by coordinates
71
+ await session.validation('The cart lists the Sauce Labs Onesie');
72
+ await session.back(); // browser history
73
+ await session.validation('A list of products is shown');
74
+ } finally {
75
+ await session.close();
76
+ }
77
+ ```
78
+
79
+ A location is `{ target: 'a description' }`, which Revyl's grounding model finds on the current page, or `{ x, y }` from the top-left corner of the viewport; `screenSize()` gives the bounds and `locate(target)` gives an element's point without acting. `type()` clicks the field and clears it first unless you pass `{ clear: false }`. `pressKey()` takes `'enter'` or `'backspace'`, and `openUrl(url)` loads a page like `navigate(url)`. A failed action throws `ACTION_FAILED`. One whose outcome Revyl can't confirm throws `ACTION_UNCERTAIN` or `TIMEOUT`, so check the session before acting again. Actions are never repeated. If Verify can't reach Revyl, the action fails with `API_ERROR` and isn't resent either, so check the session before trying it again. [api.md](api.md#exact-actions) lists every call.
80
+
81
+ | Call | Web | iOS | Android | Mac computer |
82
+ | --- | --- | --- | --- | --- |
83
+ | `tap`, `type`, `swipe`, `pressKey`, `locate`, `screenSize` | Yes | Yes | Yes | No, use `exec()` and files |
84
+ | `back()` | Yes, browser history | No, tap the on-screen back control | Yes, the system back button | No |
85
+ | `openUrl(url)` | Yes, loads an http(s) URL in the tab | Yes, a URL or deep link | Yes, a URL or deep link | No |
86
+ | `launchApp(bundleId)` | No, use `openUrl` or `navigate` | Yes | Yes | No |
87
+ | `navigate(url)` | Yes | No, use `openUrl` | No, use `openUrl` | No |
88
+ | `instruction`, `validation`, your own model | Yes | Yes | Yes | No, use `exec()` |
89
+ | `screenshot()` | Yes | Yes | Yes | Yes |
90
+ | `exec`, files, processes | No, open a Mac computer | No, open a Mac computer | No, open a Mac computer | Yes |
91
+
92
+ Coordinates are in iOS points, Android pixels and Web CSS pixels, from the top-left corner. A call a platform doesn't support throws `NOT_AVAILABLE_ON_PLATFORM`, and its message names the alternative.
93
+
94
+ When you pass a [`model`](own-model.md), your model uses `tap`, `type`, `swipe`, `pressKey`, `openUrl` and, where the platform has it, `back` inside `instruction()`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revyl/verify",
3
- "version": "0.3.2",
4
- "description": "Open Revyl cloud browsers and mobile devices for agent steps, or Mac and Linux computers for commands and files, from TypeScript.",
3
+ "version": "0.4.0",
4
+ "description": "Open Revyl cloud browsers and mobile devices for agent steps, or Mac computers for commands and files, from TypeScript.",
5
5
  "keywords": [
6
6
  "e2e",
7
7
  "end-to-end",
@@ -10,7 +10,6 @@
10
10
  "android",
11
11
  "web",
12
12
  "macos",
13
- "linux",
14
13
  "ai",
15
14
  "agent",
16
15
  "revyl"