Precept 0.14.0

Precept.Screenplay

The screenplay pattern for Precept. An actor holds the abilities they were granted, performs interactions against targets, and is asked questions about what they can see.

dotnet add package Precept.Screenplay
using Precept.Screenplay;
using Precept.Screenplay.Web;

var alice = await Actor.Named("alice").WhoCanBrowseTheWebAsync();

await alice.AttemptsToAsync(
    Navigate.To("/login"),
    Enter.The("ada@example.com").Into(SignInPage.Email),
    Enter.TheSecret(password).Into(SignInPage.Password),
    Click.On(SignInPage.Submit));

await Assert.That(alice.Sees(Dashboard.Greeting)).ToHaveTextAsync("Hello, Ada");

There is nothing to register. An actor is created inside a test and belongs to it. The package brings Precept.Web with it, which is what the browser interactions run through. A suite that drives a browser through page objects installs Precept.Web on its own and is offered none of this.

Screenplay replaces nothing. Page objects and screenplay can share a project, and actor.Sees(target) returns a Playwright locator, so the assertions are the same ones Precept.Web already has.


Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: screenplay · interactions · questions and assertions · two users at once · with Gherkin

Precept 0.14.0 · MIT · © 2026

Esc