Playwright tests from plain language
An internal framework where a tester describes a scenario and a 10-phase pipeline writes the Playwright script.
Context
At Veloxcore, testers describe what needs checking in plain language. Turning that into Playwright tests takes time. A useful test has to fit the codebase it runs against: it must reuse the project’s page objects and fixtures, not invent new ones.
Problem
Generated test code is easy to produce and hard to trust. A script that ignores the existing page objects, fixtures and conventions adds maintenance work instead of removing it.
What I did
I built an internal framework out of reusable AI skills. A tester writes a scenario, and a 10-phase pipeline takes it the rest of the way. Five of those phases are:
- Requirement analysis
- Project mapping
- Manual test-case generation
- Page-object and fixture discovery
- Automated script generation
Each phase produces an artefact the next one builds on, so the output of every step can be read and checked. Mapping the project and discovering its page objects and fixtures are what keep the final script inside the existing structure.
Result
A tester can go from a written scenario to a Playwright script that uses the project’s own page objects and fixtures.
Stack
- Playwright
- TypeScript
- Page Object Model
- AI skills
Step through it
A recreation of the approach against a fictional shop app. Every artefact was written by hand in advance, and nothing here calls a language model.
- Requirement analysis. Break the scenario into who, what and the expected results, and flag anything unclear.
- Project mapping. Find where the scenario lives in the app and in the existing test project.
- Manual test-case generation. Write the checks a person would run, before any code.
- Page-object and fixture discovery. Match each step to page objects and fixtures that already exist, and note what is missing.
- Automated script generation. Write the Playwright tests using only what the previous phase found.
Static preview. The interactive version needs JavaScript.