playwright-test-cleanup

Enforces API-based cleanup of test data created by Playwright tests in Didaxis.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/tetianna/ai-assisted-qa-automation-2 --skill playwright-test-cleanup-tetianna
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-test-cleanup
Source: https://github.com/tetianna/ai-assisted-qa-automation-2/tree/main/.cursor/skills/playwright-test-cleanup
Command: npx skills add https://github.com/tetianna/ai-assisted-qa-automation-2 --skill playwright-test-cleanup-tetianna

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Playwright tests that create programs or other persistent records in Didaxis leave orphaned data behind, slowing the app and making test runs unreliable. This Skill ensures every test tracks and deletes the data it creates. ## Core Features & Use Cases - Fixture-Based Teardown: Routes all program deletion through the shared fixtures/cleanup.fixture.ts using trackProgram(uuid) instead of manual afterAll blocks. - API Cleanup Rules: Deletes records via DELETE /api/programs/<uuid> with a Bearer token, never through the UI, and never with hardcoded credentials. - Review Checklist: Provides a concrete checklist for reviewing tests, covering unique names, fixture imports, UUID tracking, and @destructive handling for shared-state mutations. - Use Case: When generating a new Playwright spec that creates a Didaxis program, apply this Skill so the test captures the program UUID from the POST response and registers it for automatic teardown. ## Quick Start Apply the playwright-test-cleanup rules to generate or review a Playwright test that creates a program so its data is tracked and deleted automatically.

Frequently Asked Questions about playwright-test-cleanup

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

FAQPage Schema
How do I clean up test data in Playwright tests?▼

Import test from the cleanup fixture instead of @playwright/test, capture the created record's UUID from the POST response, and call trackProgram(uuid) immediately. The fixture deletes tracked records via the DELETE API after the test.

How to delete programs created during Didaxis Playwright tests?▼

Programs are deleted through DELETE /api/programs/<uuid> with a Bearer token, handled automatically by the cleanup fixture. The fixture uses DIDAXIS_API_TOKEN when valid, otherwise it logs in via POST /api/auth/login with the configured credentials.

Should Playwright tests use afterAll for test data cleanup?▼

No, manual afterAll or afterEach blocks for program teardown are not used. The cleanup fixture handles teardown for every test that calls trackProgram. Only tests mutating shared global state use afterEach or afterAll to revert that state.

Why do Playwright tests need unique names for created data?▼

Unique names generated with uniqueName() or Date.now() prevent collisions between parallel runs and retries. Without them, tests can interfere with each other's data and produce flaky failures.

When is a Playwright test tagged as destructive?▼

A test is tagged @destructive when it mutates shared or global state such as locale, roles, flags, or settings. Such tests must revert that state in afterEach or afterAll and run with a single worker.