write-test-code

Generate and refactor Playwright E2E tests from TC-ID specs and exploration outputs.

4|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill write-test-code-lespaceman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-test-code
Source: https://github.com/lespaceman/athena-workflow-marketplace/tree/main/plugins/playwright-automation/skills/write-test-code
Command: npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill write-test-code-lespaceman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill should be used when writing, refactoring, or modifying Playwright E2E test code. It covers creating test files from TC-ID specs, converting browser exploration results to executable tests, refactoring locators or fixtures, adding API mocking, test data setup/teardown, and parallel-safe isolation. Includes locator strategy hierarchy, auth setup patterns, fixture design, teardown strategies, and network interception recipes. Triggers: "write a test for", "add a test case", "refactor this locator", "add error path tests", "convert specs to code", "add API mocking", "set up auth for tests". NOT for: full pipeline from scratch (use add-playwright-tests), shared live-site exploration (use capture-feature-evidence), generating specs without code (use plan-test-coverage or generate-test-cases), diagnosing flaky tests (use fix-flaky-tests).

Core Features & Use Cases

  • Create test files from TC-ID specs and browser exploration results
  • Refactor locators, fixtures, and page objects for stability and maintainability
  • Add API mocking, test data setup/teardown, and parallel-safe isolation
  • Include locator strategy hierarchy, auth setup patterns, fixtures, teardown, and network interception recipes

Quick Start

Provide a TC-ID spec or exploration result and the skill will generate a Playwright test file with fixtures and page objects.

Frequently Asked Questions about write-test-code

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

FAQPage Schema
How do I generate Playwright E2E tests from specifications?

Playwright E2E tests can be generated from TC-ID specs or exploration outputs. The tool creates test files with fixtures, page objects, and stable locator patterns directly from the provided specifications.

What is the best way to refactor Playwright locators for test stability?

Refactoring Playwright locators improves test stability by applying a locator strategy hierarchy. This ensures tests use resilient selectors, proper fixtures, and maintainable page objects for deterministic execution.

How do I add API mocking and network interception to Playwright tests?

API mocking and network interception are added to Playwright tests using network interception recipes. This allows wiring data setup and teardown to ensure deterministic, parallel-safe test isolation.

Can I use this to set up authentication patterns and fixtures for E2E testing?

Authentication setup patterns and fixtures are supported for E2E testing. It provides strategies for wiring auth setup and teardown to keep tests parallel-safe and maintainable.

When should I not use this approach for writing test code?

This approach for writing test code should not be used for diagnosing flaky tests or generating specs without code. It is specifically for creating and refining tests from existing specifications and exploration outputs.

Does this tool support converting browser exploration results to executable tests?

Converting browser exploration results to executable tests is fully supported. It transforms exploration outputs into Playwright test code with proper locators, fixtures, and parallel-safe isolation.