vitalets/playwright-bdd

Feature: possibility to define the path to the config file

Closed this issue · 5 comments

The problem
I don't have the playwright config file in the root of the project but into a subdirectory. With the actual version there is no parameter or env variable to define (or at least documented) to change this.

A solution
give a way (parameter or env variable or beter, both, to provide configuration path to the file)

thanks

the feature exist, it's just not documented : use --config=
so i Would adviced to output it to the cli when using --help

It is shown in the help output for sub command:

$ npx bddgen test -h

Usage: bddgen test [options]

Generate Playwright test files from Gherkin documents

Options:
  -c, --config <file>  Path to Playwright configuration file (default: playwright.config.(js|ts))
  --tags <expression>  Tags expression to filter scenarios for generation
  --verbose            Verbose mode (default: false)
  -h, --help           display help for command

But I agree this is not obvious, I will update that.
Thanks for highlighting.

Indeed

But it does appears in the output of npx bddgen -h
nor in the documentation.

But otherwise it's working. So not a big issue

I'd expect to see --config option here:

$ npx bddgen -h
Usage: bddgen [options] [command]

Playwright-bdd CLI v7.2.1

Options:
  -V, --version     output the version number
  -h, --help        display help for command
 -c, --config     <- to be added!

Commands:
  test [options]    Generate Playwright test files from Gherkin documents
  export [options]  Prints step definitions
  env [options]     Prints environment info

In the documentation it is mentioned as -c not as --config.

Added in v.7.2.2.

$ npx bddgen -h
Usage: bddgen [options] [command]

Playwright-bdd CLI v7.2.2

Options:
  -c, --config <file>  Path to Playwright configuration file (default: playwright.config.(js|ts))
  -v, --version        Output playwright-bdd version
  -h, --help           display help for command

Commands:
  test [options]       Generate Playwright test files from Gherkin documents
  export [options]     Prints step definitions
  env                  Prints environment info