Create playwright test data

From PrestaShop/PrestaShop · View interactive version

Create playwright test data is an AI agent skill from the GitHub repository PrestaShop/PrestaShop. Create Faker data classes and predefined data objects for a new entity in the ui-testing-library. These are imported by campaigns for consistent test data generation. Trigger: "create test data for {Domain}".

How to use this skill

Skill file

create-playwright-test-data

Read @.ai/Component/Playwright/CONTEXT.md for the stack and data patterns.

Faker data classes and predefined data objects live in the ui-testing-library, not in the core repo.

1. Faker data class

Create Faker{Domain} in the ui-testing-library:

// Usage in campaigns:
const createTaxData: FakerTax = new FakerTax();
const editTaxData: FakerTax = new FakerTax({enabled: false});

Reference: check existing Faker classes in the ui-testing-library (e.g. FakerTax, FakerProduct)

2. Predefined data objects

Create data{Domain} objects referencing demo install fixtures:

// Usage in campaigns:
import {dataTaxes} from '@prestashop-core/ui-testing';
dataTaxes.DefaultFrTax.id;
dataTaxes.DefaultFrTax.name;

These reference entities that exist in the vanilla PrestaShop installation — useful for tests that filter/sort existing data rather than creating new entities.

3. Local data files (if needed)

For campaign-specific data that doesn't fit in the library, create tests/UI/data/{domain}.ts in the core repo:

Rules

Conventions (no random data in assertions, deterministic Faker values) are in Playwright/CONTEXT.md. Skill-specific reminders:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.