cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.04k stars 1.09k forks source link

Config Path specify configuration file using CLI `-c, --config <PATH>` missing in version 9.2.0 #2293

Closed kannan-work closed 1 year ago

kannan-work commented 1 year ago

👓 What did you see?

Config Path specify configuration file using CLI -c, --config missing in version 9.2.0

✅ What did you expect to see?

Please let me know, How to map the config file path without using --config or -c

📦 Which tool/library version are you using?

@cucumber/cucumber v9.2.0

🔬 How could we reproduce it?

Steps to reproduce the behavior: Please run the command npx cucumber-js --help and you will see the -c --config path is missing

📚 Any additional context?


Screenshot 2023-06-26 at 13 47 03

This text was originally generated from a template, then edited by hand. You can modify the template here.

davidjgoss commented 1 year ago

When I run npx cucumber-js --help from a new project:

Usage: cucumber-js [options] [<GLOB|DIR|FILE[:LINE]>...]

Options:
  -v, --version                    output the version number
  -b, --backtrace                  show full backtrace for errors
  -c, --config <PATH>              specify configuration file
  -d, --dry-run                    invoke formatters without executing steps
  --exit, --force-exit             force shutdown of the event loop when the test run has finished: cucumber will call process.exit
  --fail-fast                      abort the run on first failure
  -f, --format <TYPE[:PATH]>       specify the output format, optionally supply PATH to redirect formatter output (repeatable).  Available formats:
      json: Prints the feature as JSON. The JSON format is in maintenance mode. Please consider using the message formatter with the standalone json-formatter (https://github.com/cucumber/json-formatter).
      message: Outputs protobuf messages
      html: Outputs HTML report
      progress: Prints one character per scenario.
      progress-bar: Similar to the Progress Formatter, but provides a real-time updating progress bar based on the total number of steps to be executed in the test run
      rerun: Prints failing files with line numbers.
      snippets: The Snippets Formatter doesn't output anything regarding the test run; it just prints snippets to implement any undefined steps
      summary: Summary output of feature and scenarios
      usage: Prints where step definitions are used. The slowest step definitions (with duration) are listed first. If --dry-run is used the duration is not shown, and step definitions are sorted by filename instead.
      usage-json: Does what the Usage Formatter does, but outputs JSON, which can be output to a file and then consumed by other tools.
      junit: Outputs JUnit report

  --format-options <JSON>          provide options for formatters (repeatable)
  --i18n-keywords <ISO 639-1>      list language keywords
  --i18n-languages                 list languages
  -i, --import <GLOB|DIR|FILE>     import files before executing features (repeatable)
  --language <ISO 639-1>           provide the default language for feature files
  --name <REGEXP>                  only execute the scenarios with name matching the expression (repeatable)
  --order <TYPE[:SEED]>            run scenarios in the specified order. Type should be `defined` or `random`
  -p, --profile <NAME>             specify the profile to use (repeatable) (default: [])
  --parallel <NUMBER_OF_WORKERS>   run in parallel with the given number of workers
  --publish                        Publish a report to https://reports.cucumber.io
  --publish-quiet                  Don't print information banner about publishing reports
  -r, --require <GLOB|DIR|FILE>    require files before executing features (repeatable)
  --require-module <NODE_MODULE>   require node modules before requiring files (repeatable)
  --retry <NUMBER_OF_RETRIES>      specify the number of times to retry failing test cases (default: 0)
  --retry-tag-filter <EXPRESSION>  only retries the features or scenarios with tags matching the expression (repeatable).
          This option requires '--retry' to be specified.
  --strict                         fail if there are pending steps
  --no-strict                      succeed even if there are pending steps
  -t, --tags <EXPRESSION>          only execute the features or scenarios with tags matching the expression (repeatable)
  --world-parameters <JSON>        provide parameters that will be passed to the world constructor (repeatable)
  -h, --help                       display help for command
For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md
davidjgoss commented 1 year ago

From certain other keys that are missing e.g. --import and the lack of details around formatters I think that is quite an old version generating that message. Is it possible you have the old cucumber package installed? Or maybe an older version of @cucumber/cucumber coming through another dependency.

It might be worth running:

npm why @cucumber/cucumber
npm why cucumber
kannan-work commented 1 year ago

I uninstall @cucumber/cucumber and reinstalled the latest version(9.2.0) of @cucumber/cucumber and now --config path is working. Thanks for your time in investigating