Skip to content

[Feature]: create-playwright: --quiet by default if all required CLI flags passed #29894

@karlhorky

Description

@karlhorky

🚀 Feature Request

If a user specifies a create-playwright option (eg. --no-browsers), create-playwright should use this option value and skip the interactive question.

This effectively makes the create-playwright behavior the same as setting the --quiet option, if users pass all required options (see below, from the options list):

Usage: npx create-playwright@latest [options] [rootDir]
    Available options are:
      ...
      --quiet: do not ask for interactive input prompts

Implementation

enquirer supports skipping prompts in the prompt options if certain criteria is met:

Example

$ pnpm create playwright --test-dir=test --lang=ts --browsers
# This will set custom options non-interactively and skip the interactive prompts

The example above requires the create-playwright flags --test-dir and --browsers, which are feature requests here:

Motivation

This will cause the create-playwright behavior to match intuitive behavior of other well-known CLIs in the JS/TS ecosystem

Alternatives Considered

Use the verbose, undocumented environment variable TEST_OPTIONS which can be set to a JSON string:

TEST_OPTIONS='{"installGitHubActions": true, "language": "TypeScript", "installPlaywrightDependencies": false, "testDir": "playwright", "installPlaywrightBrowsers": true}' pnpm create playwright

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions