Skip to content

[Feature]: create-playwright should ensure non-interactive setup for AI agents #39986

@karlhorky

Description

@karlhorky

🚀 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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions