Skip to content

[Feature]: Show/dump config #38233

@holtkampjs

Description

@holtkampjs

🚀 Feature Request

Many tools with a configuration file(s) support variations of <cmd> show-config, <cmd> --show-config, or <cmd> --dump-config for debugging the configuration process. I believe that would be a useful feature to include in this project to ensure that changes to playwright.config.* are being picked up properly and resulting in expected values.

Design ideas

If the command were laid out under a debug subcommand i.e. playwright debug dump-config. This would allow options like this not to pollute the help output from playwright --help or playwright help and provide a place for further additions such as playwright debug doctor (just an idea) that could lay out the status of installed browsers / browser dependencies.

Example

This feature could be designed to be used as:

playwright debug config
Configuration file: /absolute/path/to/playwright.config.ts

Settings:

testDir: '.' (default)
fullyParallel: false (default)
use:
  baseURL: https://some.url
webServer:
  command: 'npm run start'
  url: https://some.url

The command could have a default behavior such as only dumping configuration values which are configured within the config file.

In the absence of a playwright.config.{js,ts} files, an error such as:

playwright debug config
Error: No file named playwright.config.{js,ts} found in the current directory
Hint: Try again with the "--all" flag to show default config values

With that said, a flag such as --all could be used to dump any playwright config values, set or unset, for debugging configuration.

If config values are computed, such as process.env.CI ? 1 : 3, could be annotated with (computed) or (dynamic) could be used to denote that this value is subject to change.

Motivation

The motivation for this is just to make it easier for debugging configuration values and this behavior seems common in other tools I have used.

Acute motivation

The experience which has driven me to create this issue is described by the following.

File structure

...
./playwright/tests/
...
./package.json
./playwright.config.ts

playwright script in package.json

"playwright": "cd playwright && playwright test",

My question

When moving into the playwright/ directory prior to executing the playwright test command, it is unclear to me whether or not the configuration values defined in ./playwright.config.ts are respected or ignored.

I understand that this behavior is likely documented somewhere but it was a case where I have not found this yet and the utility of a feature like this extends beyond my individual use case. Specifically in text based environments such as CI pipelines when debugging issues such as configurations not applying as expected.

How can I know in my GitHub workflow whether or not my configuration is being picked up and what are computed values rendered as?

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