Skip to content

Overview

Scriptorium.Nib.Browser is the browser-testing layer for the Scriptorium family. It extends Scriptorium.Nib’s composable assertions with Playwright-powered DOM checks and wraps Scriptorium.Quill’s test DSL with helpers that manage browser lifecycle automatically.

Terminal window
dotnet add package Scriptorium.Nib.Browser
npm install -D playwright

Install the Playwright browser binaries (one-time setup):

Terminal window
npx playwright install chromium

DomAssertion<'a> is the async counterpart of Nib’s Assertion<'a>. It returns a Promise so that each step can await Playwright operations.

Compose DomAssertion values with the >>. operator (note the dot after >>):

open Scriptorium.Nib.Browser
open Glutinum.Playwright
let myAssertion: DomAssertion<Locator> =
toBeVisible >>. containText "Submit"

Runs a DomAssertion chain against a locator. Rejects the promise if any assertion fails.

let assertExample () =
promise {
do! assertLocator (page.locator "button") (
toBeVisible >>. containText "Submit" >>. beEnabled
)
}