Skip to content

Revyl

E2E.Revyl is a browser provider for the web engine. It ports the web part of upstream’s @e2e-dev/revyl (revylBrowsers(), docs/integrations/revyl.mdx). RevylBrowsers starts a Revyl web session for each test attempt and attaches the web engine to its Chrome over CDP, so web tests use the same App, Screen, Browser, and Expect APIs as on a local browser. Upstream’s mobile device provider, revyl(), is not ported.

Terminal window
dotnet add package E2E.NUnit # or E2E.XUnit.V3, E2E.TUnit
dotnet add package E2E.Revyl

Set REVYL_API_KEY in the environment that starts the tests. In CI, store it as a secret. Without it, the lease fails before any test starts. REVYL_API_URL reaches another Revyl backend.

Create a Web app in Revyl, for example with revyl app create --name "My site" --platform web, and pass its id as App. Url is the page each session opens on; Revyl registers it as a build of the app and checks that it loads before the test starts. Set the engine’s Viewport to null and give the session’s size to RevylBrowsersOptions, since a Revyl browser keeps the size its session opened with.

using E2E.Engine;
using E2E.Revyl;
var options = new WebEngineOptions
{
Browser = new RevylBrowsers(
new RevylBrowsersOptions
{
App = "<Revyl Web app id>",
Url = "https://staging.example.com",
Viewport = new WebViewport(1280, 800),
}
),
Viewport = null,
};

The reporter logs session <id>, watch at <link> for each session. The link opens the session in Revyl, live while the test runs, and needs a Revyl sign-in. With REVYL_API_URL set, it logs session <id> alone.

Option Default Purpose
App required Id of the Revyl Web app the sessions run under.
Url required http(s) URL each session opens on, without credentials in it. Revyl must be able to load it.
Viewport 1280 by 800 Width and height in CSS pixels, 320 to 3840 by 240 to 2160. The browser keeps it for the whole session.
IdleTimeoutSeconds 600 Seconds without activity before Revyl ends a session the run left open, at least 60.

A value out of range fails at construction with INVALID_CONFIG.

  • Every attempt, retries included, starts a new session, on the session’s one browser context and its first tab. Each test pays for a session start, and the limits of a per-attempt lease apply (see Browser).
  • The web engine’s Viewport must be null. Revyl refuses to resize the browser: Browser.SetViewportAsync fails at once, and a set engine Viewport leaves the attempt waiting until the test times out.
  • The CDP URL works once. A dropped connection is not reattached, and the attempt fails; a retry starts a new session.
  • An attempt that records video gets Revyl’s own recording of the session as video/recording.mp4. Revyl publishes it only once the session ends, so stopping a recording ends the session.
  • Downloads are unavailable: Revyl’s browser refuses them.
  • The site runs on Revyl’s network, so point Url and the target’s App.Url at a deployed URL, not localhost.
  • When an attempt ends, on every exit path, the provider stops its session. When the run ends, it stops the session of any worker that died before it could. If the run itself dies, Revyl ends each session after IdleTimeoutSeconds without activity.
  • Not checked against a live Revyl account: the calls follow upstream’s client.