Skip to content

Element Snapshots

Element Snapshots are a custom snapshot implementation inspired by Playwright's ARIA Snapshots and the Accessibility Object Model. They cover additional properties, e.g. validation attributes like required or invalid on form inputs, and are optimized to be serialized as JSON.

Element Snapshots are designed to be used in combination with playwright-file-snapshots for writing Playwright tests.

Experimental

Element Snapshots are currently experimental. Not all HTML elements, ARIA roles and attributes are covered. Breaking changes to the snapshot format are possible.

Installation

shell
pnpm add -D @cronn/element-snapshot
shell
npm install -D @cronn/element-snapshot
shell
yarn add -D @cronn/element-snapshot