An end-to-end test with Playwright

Software testing promptsDifficulty: Intermediate Last updated: 16 November 2026

Usage description

Write an E2E test for a critical user flow with stable selectors.

Prompt text

Prompt
Write a Playwright test (TypeScript) for the following flow in {{project}}: {{extra}}.
- Use role- and label-based selectors (getByRole, getByLabel), not brittle CSS.
- Do not use fixed waits (waitForTimeout); rely on auto-waiting assertions.
- Prepare the data through the API or fixtures, not through the UI.
- Test desktop and mobile, and the RTL direction.
- Give me the run command and its actual result.

Required inputs

The flow and the test environment URL.

Expected outputs

The test file, the configuration and the result.

Suitable tools

Practical example

extra = "sign up → confirm email → create the first project".

Rate:
No ratings yet

We do not claim this prompt was tested on a particular model; results vary with the model and context, so always review the output.

Create a custom version with AI

Do not write secrets, keys or personal data. The description is merged with the prompt directly, without sending it to any external service.