hyva-themes avatar

Hyva Playwright Test

If you're writing Playwright tests for Hyvä Magento storefronts, this fixes the pain points you'll hit in the first hour. Hyvä replaces Knockout with Alpine.js, which scatters hidden x-show elements throughout the DOM that break Playwright's strict mode. The skill documents the essential workarounds: scoping message selectors to #messages, handling x-defer lazy loading with scrollIntoViewIfNeeded, waiting for Alpine's async updates with proper timeouts instead of sleep calls. It pushes you toward getByRole over CSS selectors and includes before/after examples for common gotchas like cart badges, filters, and pagination. The reference files show actual page object patterns if you need working code to copy.

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

Install

$ npx -y skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test --agent claude-code

Installs into .claude/skills of the current project.

Files

Writing Playwright Tests for Hyvä + Alpine.js

Overview

Hyvä replaces Luma's KnockoutJS/RequireJS/jQuery with Alpine.js + Tailwind CSS. Playwright's strict mode (rejects locators matching multiple elements) conflicts with Alpine.js DOM patterns where hidden elements exist throughout the page. This skill documents pitfalls and solutions discovered while writing Playwright tests for Hyvä storefronts.

The #1 Rule: Hidden Alpine Elements

Hyvä templates scatter elements like <div x-show="displayErrorMessage" class="message error"> throughout the DOM. These are invisible but present, so a bare selector like .message.error matches both hidden and visible instances, causing Playwright strict mode violations.

Always scope page-level messages to the #messages container:

// WRONG — matches hidden Alpine x-show elements throughout DOM
await expect(page.locator('.message.success')).toContainText('Added to cart');
await expect(page.locator('.message-error')).toContainText('Error');

Sponsors

Details

Repository
github.com/hyva-themes/hyva-ai-tools
Categories
Testing & QA, Documentation, AI & Agent Building, Debugging
First seen
Jun 3, 2026

More from hyva-themes/hyva-ai-tools

All 12
1levnikolaevich avatarln-632-test-e2e-priority-auditorlevnikolaevich/claude-code-skillsAudits E2E coverage for critical user-visible journeys and wasteful E2E tests. Use when reviewing E2E journey value.381skills.sh installs
2ai-dashboad avatare2e-testingai-dashboad/flutter-skillAI-powered E2E testing for any app — Flutter, React Native, iOS, Android, Electron, Tauri, KMP, .NET MAUI. Connects via MCP to running apps so the agent can tak262skills.sh installs
3m1heng avatarfeishu-e2e-testm1heng/clawdbot-feishuLocal E2E debug and test framework for clawd-feishu plugin development. Use when debugging message flow, testing bot responses, verifying Feishu web UI interact122skills.sh installs
4cin12211 avatarjest-testing-expertcin12211/orca-qExpert in Jest testing framework, advanced mocking strategies, snapshot testing, async patterns, TypeScript integration, and performance optimization116skills.sh installs
5dart-lang avatardart-add-unit-testdart-lang/skillsWrite and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correc20.4Kskills.sh installs
6bmad-code-org avatarbmad-qa-generate-e2e-testsbmad-code-org/bmad-methodGenerate end to end automated tests for existing features. Use when the user says "create qa automated tests for [feature]"14.6Kskills.sh installs