Skip to content

Provide a property name variant for each runtime option #1675

@mpkorstanje

Description

@mpkorstanje

Summary

It is possible to pass properties to cucumber using CLI arguments in a property. E.g.

mvn clean test -Dcucumber.options="--strict --monochrome"

This is rather complicate, esp when multiple layers are involved and qoutes get confusing (e.x: #1596).

mvn clean test -Dcucumber.options='--strict --monochrome --tags "not @ignored"'

A better way to do this would be to provide each option individually:

mvn clean test -Dcucumber.strict=true -Dcucumber.monochrome=true -Dcucumber.tags="not @ignored"

Once this is available we deprecate cucumber.options.

Possible Solution

In develop-v5 the CucumberPropertiesParser.parse method is provided with a map containing properties from either either a cucumber.properties file, environment variables, or system properties.

After parsing cucumber.options an options builder is created. When a property is present the builder can be used to set the matching option to the right value.

Supported properties:

cucumber.glue=<separated list of paths>  #using OS appropriate seperator
cucumber.features=<separated list of paths>   #using OS appropriate seperator
cucumber.tags=<single tag expression>
cucumber.name=<regex>
cucumber.ansi-colors.disabled=<boolean>
cucumber.execution.dry-run=<boolean>
cucumber.execution.strict=<boolean>
cucumber.execution.parallel.config.fixed.parallelism=<int>
cucumber.execution.limit=<positive integer>
cucumber.execution.order=<reverse|random|random:seed>
cucumber.snippet-type=<underscore|camelcase>
cucumber.wip=<boolean>

Property names where possible should match those used by JUnit 5: https://github.com/cucumber/cucumber-jvm/blob/junit-jupiter/junit-platform-engine/src/main/java/io/cucucumber/jupiter/engine/Constants.java

To document this properly with Java doc please take hints from:

https://junit.org/junit5/docs/current/api/constant-values.html
https://junit.org/junit5/docs/current/api/org/junit/jupiter/engine/Constants.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions