test-ids-web

Standardize data-testid attributes with kebab-case naming for web testing.

3|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/guicheffer/devorch-cli --skill test-ids-web
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-ids-web
Source: https://github.com/guicheffer/devorch-cli/tree/main/templates/skills/testing/test-ids-web
Command: npx skills add https://github.com/guicheffer/devorch-cli --skill test-ids-web

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of creating stable, maintainable, and accessible test selectors in web applications by standardizing the use of data-testid attributes.

Core Features & Use Cases

  • Consistent Test Selectors: Enforces the use of data-testid for reliable element identification in tests.
  • Naming Conventions: Provides clear guidelines for descriptive, context-aware, and hierarchical naming.
  • Dynamic IDs: Demonstrates patterns for generating unique IDs for dynamic content and lists.
  • Use Case: When writing end-to-end tests with Playwright or Cypress, use data-testid to reliably target UI elements, ensuring tests don't break due to minor CSS or DOM structure changes.

Quick Start

Use the test-ids-web skill to implement data-testid attributes with kebab-case naming for all interactive elements in your web components.

Frequently Asked Questions about test-ids-web

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

FAQPage Schema
What is the best way to implement data-testid attributes for web testing?

The best way to implement data-testid attributes is to standardize them using kebab-case naming conventions. This approach provides stable, maintainable, and accessible selectors for reliable element identification in automated web testing.

How do I create dynamic data-testid selectors for list items in React?

You create dynamic data-testid selectors by applying hierarchical naming patterns to generate unique IDs for dynamic content and lists. This ensures each element maintains a consistent, context-aware identifier during automated testing.

Why use data-testid attributes instead of CSS selectors in Playwright and Cypress?

You use data-testid attributes instead of CSS selectors to ensure tests do not break due to minor CSS or DOM structure changes. This standardization provides stable, accessible selectors for robust automated testing frameworks.

Does the data-testid standardization approach work with React Testing Library?

Yes, data-testid standardization works directly with React Testing Library. It enforces kebab-case naming conventions and provides patterns for hierarchical test IDs, ensuring reliable element targeting in JavaScript applications.

When should I use hierarchical naming conventions for test IDs?

You should use hierarchical naming conventions for test IDs when building complex web components with dynamic content. This standardization creates descriptive, context-aware selectors that maintain test stability across DOM structure changes.