playwright-assertions

Validate element states, content, attributes, and page properties with Playwright assertions.

8|2|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/bradtaylorsf/alphaagent-team --skill playwright-assertions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-assertions
Source: https://github.com/bradtaylorsf/alphaagent-team/tree/main/plugins/aai-stack-playwright/skills/playwright-assertions
Command: npx skills add https://github.com/bradtaylorsf/alphaagent-team --skill playwright-assertions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to using Playwright's powerful assertion library, ensuring robust and reliable automated testing for web applications.

Core Features & Use Cases

  • Element State Checks: Verify visibility, enabled/disabled status, and focus.
  • Content Verification: Assert text content, input values, and select options.
  • Attribute & Style Validation: Check for required attributes, specific class names, and CSS properties.
  • Page & Response Assertions: Validate URLs, titles, and API response status codes.
  • Advanced Features: Includes soft assertions, custom timeouts, polling, snapshots, and accessibility checks.
  • Use Case: When writing Playwright tests, ensure that a dynamically loaded success message appears within a specific time frame and that a form submission button is disabled until all required fields are filled.

Quick Start

Use the playwright-assertions skill to verify that an element with the role 'button' is visible on the page.

Frequently Asked Questions about playwright-assertions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Playwright assertions to verify element states in web testing?

Playwright assertions verify element states like visibility, enabled or disabled status, and focus. You can check that a dynamically loaded success message appears or that a form submission button remains disabled until all required fields are filled.

What is the difference between soft assertions and auto-retrying assertions in Playwright?

Auto-retrying assertions poll element states until conditions are met or a timeout is reached, ensuring deterministic tests. Soft assertions continue executing subsequent test steps even if an assertion fails, allowing you to collect multiple validation errors before ending the test run.

How do I validate URLs, titles, and API response status codes in Playwright?

You can validate URLs, titles, and API response status codes using Playwright page and response assertions. These assertion patterns allow you to confirm navigation events and verify that network responses return expected status codes during end-to-end testing.

Can I check for specific CSS properties and attributes using Playwright assertions?

Yes, Playwright assertions support attribute and style validation. You can assert specific class names, check for required attributes, and validate CSS properties to ensure web elements render with the correct styling and structural configuration.

How do I handle dynamically loaded content and custom timeouts in Playwright testing?

You handle dynamically loaded content by leveraging Playwright auto-retrying assertions with custom timeouts. This approach polls the DOM to verify that elements appear and meet expected states within a specific time frame, ensuring reliable end-to-end testing.

What are the limitations of Playwright soft assertions for end-to-end testing?

Soft assertions do not stop test execution upon failure, meaning subsequent steps run against a potentially invalid state. You should avoid using them when downstream actions depend on the successful validation of prior element states or page properties.