🚀 Feature Request
Allow specifying testDir non-interactively with create-playwright, for example via --test-dir=playwright.
This matters more now for AI agents running setup CLIs. If an agent is given explicit scaffold flags but still hits an interactive Where to put your end-to-end tests? prompt, the flow becomes brittle. Agents sometimes answer prompts incorrectly or fail to continue at all. A first-class --test-dir flag would let them use create-playwright as the source of truth instead of falling back to handwritten scaffolding.
Example
pnpm create playwright --test-dir=playwright
This would:
- create and use the
playwright test directory
- skip the interactive
Where to put your end-to-end tests? prompt
Motivation
Non-interactive scaffolding is increasingly important for AI agent workflows. When agents cannot complete official project generators deterministically, they often fall back to generating files from model knowledge instead. That tends to drift from current Playwright defaults and best practices.
Next.js recently made the same kind of change in create-next-app so explicit CLI flags can avoid interactive prompts and remain agent-friendly:
Adding --test-dir would move create-playwright in the same direction. It would also complement broader work around skipping prompts when options are provided, such as:
Original related request:
🚀 Feature Request
Allow specifying
testDirnon-interactively withcreate-playwright, for example via--test-dir=playwright.This matters more now for AI agents running setup CLIs. If an agent is given explicit scaffold flags but still hits an interactive
Where to put your end-to-end tests?prompt, the flow becomes brittle. Agents sometimes answer prompts incorrectly or fail to continue at all. A first-class--test-dirflag would let them usecreate-playwrightas the source of truth instead of falling back to handwritten scaffolding.Example
This would:
playwrighttest directoryWhere to put your end-to-end tests?promptMotivation
Non-interactive scaffolding is increasingly important for AI agent workflows. When agents cannot complete official project generators deterministically, they often fall back to generating files from model knowledge instead. That tends to drift from current Playwright defaults and best practices.
Next.js recently made the same kind of change in
create-next-appso explicit CLI flags can avoid interactive prompts and remain agent-friendly:Adding
--test-dirwould movecreate-playwrightin the same direction. It would also complement broader work around skipping prompts when options are provided, such as:Original related request: