generate-tests

Write and validate pytest-playwright E2E tests with a self-healing debug loop.

1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/marcocelone/demo-python-ai-agent-project --skill generate-tests-marcocelone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: generate-tests
Source: https://github.com/marcocelone/demo-python-ai-agent-project/tree/main/.claude/skills/generate-tests
Command: npx skills add https://github.com/marcocelone/demo-python-ai-agent-project --skill generate-tests-marcocelone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, pytest-playwright.

What problem does it solve? Writing end-to-end tests often means guessing selectors, running tests blindly, and manually debugging failures. This Skill automates the full cycle of writing pytest-playwright tests, validating selectors against a real browser, and diagnosing failures until tests pass. ## Core Features & Use Cases - Test Generation: Writes pytest-playwright test files following page object model patterns, conftest fixtures, and locator priority rules from project conventions. - Real Browser Validation: Uses Playwright MCP to verify selectors actually exist on live pages before and after writing tests. - Self-Healing Debug Loop: Diagnoses failures via a three-way check (error output, live browser, frontend source), distinguishes test bugs from app bugs, and auto-repairs changed selectors with an auditable LOCATOR_CHANGES.md log. - Use Case: Ask it to test the event booking flow, and it writes tests/test_booking.py, verifies selectors against the live site, runs pytest, fixes any failures, and reports which business rules are covered. ## Quick Start Ask the agent to generate and validate pytest-playwright E2E tests for the booking cancellation flow.

Frequently Asked Questions about generate-tests

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

FAQPage Schema
How do I generate pytest-playwright E2E tests automatically?▼

Provide the feature or flow to test, and the agent writes a test file under tests/ using page object models and conftest fixtures. It then validates selectors in a real browser via Playwright MCP and runs pytest until all tests pass.

How to fix flaky Playwright tests caused by changed selectors?▼

The skill diagnoses failures by cross-checking the error output, the live page in a browser, and the frontend source code. If a selector changed, it auto-updates the locator following the priority order and logs the change in LOCATOR_CHANGES.md for review.

Does pytest-playwright work with page object model patterns?▼

Yes, the tests use page object model classes with typed locators defined in __init__ and action methods, while assertions stay in test files. Fixtures in conftest.py inject individual page objects or a clean_session bundle with a logged-in user.

Can I run pytest-playwright tests against a staging environment?▼

Yes, tests run against a live staging URL with no local app setup required. You can override the base URL by setting the BASE_URL environment variable before running pytest.

When should a failing test not be auto-fixed?▼

Auto-repair is skipped when the failure indicates a potential app bug rather than a selector change, when business logic behavior changed, or when the new selector cannot reliably identify the intended element. These cases are reported instead of silently adapted.