liveBook · Manning

@serenity-js/assertions

As explained in BDD in Action, Second Edition

@serenity-js/assertions is a Serenity/JS module providing assertions and expectations for verifying application state in automated tests.

Provides Screenplay Pattern-compatible assertions for checking whether an application reaches the expected state during an automated scenario. section 15.1.7

A practical verification flow handles transient interface feedback by:

  • Triggering the relevant state, such as submitting a duplicate email address. section 15.1.7

Reusable submission verification

A domain-level task such as VerifySubmission.failedWith(expectedMessage) can combine message matching, error-status verification, and notification dismissal behind a readable acceptance step.

How BDD in Action, Second Edition covers it

How deep it goes
Explains matcher-based checks and transient-message handling, while deferring broader web-interface interaction.
Examples
Uses duplicate email registration, toaster HTML, and VerifySubmission tasks as concrete verification examples.
What it assumes
Assumes actors and tasks, while introducing page elements and the basic mechanics of checking transient web feedback.
What you can do after
Apply it via @serenity-js/assertions to verify expected messages, presence, absence, equality, and inclusion.
How it connects
Connects assertions with the Screenplay Pattern, tasks, page elements, waits, and web-element text.

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.