Skip to content
hyva-themes avatar

Hyva Playwright Test

Playwright test authoring guide for Hyvä Magento storefronts, covering Alpine.js selector and timing pitfalls.

CCM score
67 of 100
skills.sh installs
1.4K
GitHub stars
86
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers strict-mode pitfalls from hidden Alpine x-show elements, plus scoping rules, selector priority, and async assertion timing
  • Includes a Hyvä-versus-Luma selector map for pagination, filters, cart badge, messages, menus, and gallery images
  • Enforces scoping flash messages to #messages and avoids :visible and waitForTimeout() in favor of web-first assertions
  • Designed for QA engineers writing e2e tests for Hyvä storefronts that use Alpine.js and Tailwind CSS

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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');

Details

Repository
github.com/hyva-themes/hyva-ai-tools
Categories
Testing & QA, Frontend & UI Code
First seen
Jun 3, 2026

More from hyva-themes/hyva-ai-tools

All 12

Similar to Hyva Playwright Test

More Testing & QA