# hyva-playwright-test

Guides writing Playwright end-to-end tests for Hyvä Magento storefronts using Alpine.js. It resolves locator conflicts caused by hidden DOM elements.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1300 installs · ★ 85
- Author: hyva-themes
- License: OSL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hyva-themes/hyva-ai-tools/tree/HEAD/skills/hyva-playwright-test/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/hyva-playwright-test

## What it does

The skill outlines testing strategies for Hyvä storefronts on Magento, where Alpine.js and Tailwind CSS replace Luma's default stack. A frequent stumbling block is Playwright strict mode failing on generic selectors. Alpine templates retain invisible elements like error messages in the DOM via `x-show`, producing multiple locator matches. Scoping flash notifications directly to `#messages` fixes this failure.

Inside, the skill details workarounds for Alpine lifecycle states. It explains how to scroll elements into view before evaluating `x-defer="intersect"` attributes and how to wait for template tags controlled by `x-if`. Relying on the `:visible` pseudo-class is explicitly discouraged in favor of container scoping and ARIA role locators.

## Requirements
- Works with: Playwright

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/hyva-playwright-test/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/hyva-playwright-test/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/hyva-playwright-test/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/hyva-playwright-test/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hyva-themes/hyva-ai-tools hyva-playwright-test
```

2. **Manually: put the files in place**
- File: `.github/skills/hyva-playwright-test/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hyva-themes/hyva-ai-tools --path skills/hyva-playwright-test
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/hyva-playwright-test/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hyva-themes/hyva-ai-tools --skill hyva-playwright-test -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hyva-themes/hyva-ai-tools/tree/HEAD/skills/hyva-playwright-test/SKILL.md

## When to use it
- configure Playwright locators for Hyvä Magento storefronts
- fix locator strict mode errors caused by hidden Alpine.js elements
- write assertions for asynchronous Alpine.js cart count updates
- handle delayed element rendering triggered by x-defer and x-if

## Example prompts
- Write a Playwright test for adding a configurable product to cart on Hyvä
- Fix strict mode locator issues with error messages on a Hyvä login form
- Show the recommended locator pattern for Hyvä pagination links

## Similar
- [magento-hyva-specialist](https://affpapa.org/en/nevibecode/skills/magento-hyva-specialist.md) — skill · 857 installs
- [playwright-best-practices](https://affpapa.org/en/nevibecode/skills/playwright-best-practices.md) — skill · 98500 installs
- [playwright-skill](https://affpapa.org/en/nevibecode/skills/playwright-skill.md) — skill · 6900 installs
- [e2e-playwright-testing](https://affpapa.org/en/nevibecode/skills/e2e-playwright-testing.md) — skill · 796 installs
- [playwright-core](https://affpapa.org/en/nevibecode/skills/playwright-core.md) — skill · 778 installs
- [playwright-e2e-testing](https://affpapa.org/en/nevibecode/skills/playwright-e2e-testing.md) — skill · 615 installs

From the same set: [hyva-themes/hyva-ai-tools](https://affpapa.org/en/nevibecode/by/hyva-themes/hyva-ai-tools.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
