wp-test-strategy

Plan and review PHPUnit, integration, and E2E test coverage for WordPress projects.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/AliJ021/labelmod-core --skill wp-test-strategy-alij021
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-test-strategy
Source: https://github.com/AliJ021/labelmod-core/tree/main/.claude/skills/wp-test-strategy
Command: npx skills add https://github.com/AliJ021/labelmod-core --skill wp-test-strategy-alij021

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Deciding what to test and how deeply to test it in WordPress projects is hard: plugins, themes, blocks, REST endpoints, and WooCommerce flows each carry different risks. This Skill provides a systematic strategy for matching test depth to risk so coverage effort goes where breakage matters most. ## Core Features & Use Cases - Test Layer Selection: Heuristics for choosing between unit tests, WordPress integration tests, and E2E/browser tests based on the change surface. - Coverage Gap Detection: Ready-to-use ripgrep search patterns to inventory existing PHPUnit, Playwright, and block tests and spot high-risk surfaces with no coverage. - Scenario Checklists: Reference guides covering plugin activation, REST permission failures, block deprecations, and WooCommerce HPOS and checkout regressions. - Use Case: Before a plugin release, ask for a review of missing coverage; the Skill maps hooks, REST routes, and checkout flows to recommended unit, integration, or E2E tests and prioritizes the highest-risk gaps. ## Quick Start Ask the assistant to review the test coverage of your WordPress plugin and recommend which unit, integration, and E2E tests to add before release.

Frequently Asked Questions about wp-test-strategy

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

FAQPage Schema
How do I decide between unit, integration, and E2E tests in WordPress?

Choose the lightest test that still gives confidence. Use unit tests for pure logic and validation, integration tests for hooks, persistence, REST routes, and capabilities, and E2E tests for editor interactions, admin forms, and checkout flows.

How to find missing test coverage in a WordPress plugin?

Use ripgrep to inventory existing tests and flag high-risk surfaces. Search for register_rest_route, add_action, wp_ajax_, dbDelta, and WC_ calls, then compare against test files extending WP_UnitTestCase or using Playwright.

What tests should WooCommerce extensions have?

WooCommerce extensions should cover HPOS-safe order access, cart and checkout regression paths, and payment or webhook edge cases. Browser-level tests are recommended for checkout and cart interactions since they involve frontend JavaScript behavior.

When should I use Playwright instead of PHPUnit for WordPress testing?

Use Playwright for browser-dependent behavior: block editor flows, admin forms with JavaScript, checkout interactions, and accessibility-sensitive UI. PHPUnit integration tests cannot exercise client-side rendering or user interaction.

When is a full E2E test suite not worth it for a WordPress plugin?

E2E tests are not worth it for pure PHP logic, formatting helpers, or validation rules decoupled from the WordPress runtime. Those are covered faster and more reliably by unit tests, reserving E2E for genuinely interactive flows.