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.
Installation
Section titled “Installation”dotnet add package Scriptorium.Nib.Browsernpm install -D playwrightInstall the Playwright browser binaries (one-time setup):
npx playwright install chromiumDomAssertion
Section titled “DomAssertion”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.Browseropen Glutinum.Playwright
let myAssertion: DomAssertion<Locator> = toBeVisible >>. containText "Submit"assertLocator — the entry point
Section titled “assertLocator — the entry point”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 ) }