Rand Stats

BDD::Behave::Playwright

zef:gdonald

BDD::Behave::Playwright

Browser lifecycle hooks and Playwright-aware matchers for BDD::Behave examples.

It is glue between BDD::Behave and WWW::Playwright. It contains no browser driving of its own; that all lives in WWW::Playwright. This distribution wires a Playwright page into a behave describe/it flow and lets you write expectations against it.

Install

zef install BDD::Behave::Playwright

The browser runtime comes from WWW::Playwright, which needs Node and a Chromium binary. After installing, run its installer once:

install

This runs npm install for the sidecar and npx playwright install chromium.

Example

use BDD::Behave;
use BDD::Behave::Playwright;

describe 'signing up', {
  playwright-page(fixture => 'specs/fixtures/form.html');

  it 'greets the user after the form is submitted', -> $_ {
    .page.locator('#username').fill('Ada');
    .page.locator('#submit').click;

    expect(.page.locator('#welcome')).to.have-text('Welcome, Ada');
  }
}

What the glue adds

Documentation

Full docs are built from docs-src with mkdocs.

License

Artistic-2.0