playwright-blazor-testing

Automate end-to-end UI testing for Blazor Server and WebAssembly with Playwright.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/tedtv1007-ctrl/milk-skills-library --skill playwright-blazor-testing-tedtv1007-ctrl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-blazor-testing
Source: https://github.com/tedtv1007-ctrl/milk-skills-library/tree/main/playwright-blazor-testing
Command: npx skills add https://github.com/tedtv1007-ctrl/milk-skills-library --skill playwright-blazor-testing-tedtv1007-ctrl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Microsoft.Playwright, Microsoft.Playwright.MSTest, xunit.

What problem does it solve?

This skill addresses the complexity of testing Blazor applications, which rely on asynchronous rendering and SignalR, by providing robust patterns for stable element selection and state management.

Core Features & Use Cases

  • Stable Selectors: Implements data-test attribute patterns to ensure tests remain resilient against UI changes.
  • Blazor-Specific Wait Strategies: Provides custom logic to handle asynchronous rendering and SignalR updates, avoiding flaky network-idle waits.
  • Use Case: Use this skill to automate regression testing for interactive Blazor forms, authentication flows, and real-time component updates in both Server and WebAssembly environments.

Quick Start

Use the playwright-blazor-testing skill to generate a test suite for the login component using data-test attributes for all input fields.

Frequently Asked Questions about playwright-blazor-testing

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

FAQPage Schema
How do I automate end-to-end testing for Blazor Server and WebAssembly apps?

Automate end-to-end testing for Blazor apps using the Playwright framework to handle complex scenarios like authentication flows, real-time SignalR updates, and responsive design verification across both Server and WebAssembly environments.

Why are my Playwright tests flaky when interacting with asynchronous Blazor components?

Playwright tests for asynchronous Blazor components are flaky due to network-idle waits; implementing Blazor-specific wait strategies handles asynchronous rendering and SignalR updates properly to ensure stable DOM interaction.

How do I use data-test attributes to create stable selectors for Blazor UI testing?

Use data-test attribute patterns for Blazor UI testing to create stable selectors that ensure tests remain resilient against UI changes, providing robust patterns for state management and reliable element selection.

Does Playwright work with SignalR real-time updates in Blazor applications?

Playwright works with SignalR real-time updates in Blazor applications by providing custom logic to handle asynchronous rendering and SignalR updates, avoiding flaky network-idle waits during interactive component testing.

Do I need Microsoft.Playwright NuGet packages to test Blazor applications?

You need Microsoft.Playwright NuGet packages, including Microsoft.Playwright.MSTest and xunit, along with proper configuration of test attributes to automate end-to-end UI testing for Blazor Server and WebAssembly applications.