aaronontheweb avatar

Playwright Blazor Testing

If you're testing Blazor apps with Playwright, the main gotcha is that internal navigation doesn't trigger page reloads, so the usual network idle waits don't work. This skill walks through the patterns that actually matter: waiting for DOM changes instead of network activity, using data-test attributes for stable selectors, handling authentication via cookie injection to skip the login dance, and catching Blazor-specific errors through the blazor-error-ui element. It covers both Server and WebAssembly modes, with concrete examples for forms, routing, and SignalR interactions. The setup is straightforward, just install the Microsoft.Playwright package and run the browser install command.

skills.sh installs
560
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill playwright-blazor-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Testing Blazor Applications with Playwright

When to Use This Skill

Use this skill when:

  • Writing end-to-end UI tests for Blazor Server or WebAssembly applications
  • Testing interactive components, forms, and user workflows
  • Verifying authentication and authorization flows
  • Testing SignalR-based real-time updates in Blazor Server
  • Capturing screenshots for visual regression testing
  • Testing responsive designs and mobile emulation
  • Debugging UI issues with browser developer tools

Core Principles

  1. Wait for Rendering - Blazor renders asynchronously; use proper wait strategies
  2. Test Attributes - Use data-test or data-testid attributes for stable selectors
  3. Headless by Default - Run tests headless in CI, headed for local debugging
  4. Handle Error UI - Always check for #blazor-error-ui to catch unhandled exceptions
  5. Avoid Network Wait States - Blazor navigation doesn't trigger network loads; wait for DOM changes
  6. Pin Browser Channels - Use specific browser channels (msedge, chrome) for reproducibility

Required NuGet Packages

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
Backend & APIs, Testing & QA, Security, Design & UI/UX, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1get-convex avatarfunction-creatorget-convex/agent-skillsCreate Convex queries, mutations, and actions with proper validation, authentication, and error handling. Use when implementing new API endpoints.560skills.sh installs
2jezweb avatarwordpress-plugin-corejezweb/claude-skillsBuild secure WordPress plugins with hooks, database interactions, Settings API, custom post types, and REST API. Covers Simple, OOP, and PSR-4 architecture patt560skills.sh installs
3aj-geddes avatarintegration-testingaj-geddes/useful-ai-promptsDesign and implement integration tests that verify component interactions, API endpoints, database operations, and external service communication. Use for integ557skills.sh installs
4aj-geddes avatarcaching-strategyaj-geddes/useful-ai-promptsImplement efficient caching strategies using Redis, Memcached, CDN, and cache invalidation patterns. Use when optimizing application performance, reducing datab551skills.sh installs
5sanjay3290 avatarmssqlsanjay3290/ai-skillsExecute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas549skills.sh installs
6aicoincom avataraicoin-accountaicoincom/coinos-skillsExchange account management: balance, positions, order history, registration, API key setup, tier upgrade. **用户问'我的'账户事件 / 活跃记录 / 活动 / 操作日志 / 登录历史 / 下单历史 / 最近操作548skills.sh installs