0

I need get feature scenarios without running tests with maven via cmd. Cucumber has 'dryRun' option. But don`t know how to add this option to pom.xml. I tried many variants, but it not helped.

Type in cmd:

mvn verify -Dfeature=Forum.feature -DdryRun=false

but I got error. -DdryRun options does not works.

Please take a look screenshot https://i.sstatic.net/Td4Of.jpg

1
  • Please embed the relevant parts of the pom.xml in your post, as that makes it easier to quote and point to the problem Commented Dec 20, 2014 at 15:47

1 Answer 1

1

According to your screenshot you have the following configuration:

<systemPropertyVariables>
    <cucumber.options>
        <![CDATA[--tags ${tags} ${dryRun} [${cucumber.features.dir}/${feature}]]>
    </cucumber.options>
</systemPropertyVariables>

This would insert true or false into the environment variable, which is not a valid option and instead gets interpreted as a path to a feature file.

Cucumber instead expects a parameter like --dry-run or --no-dry-run (https://github.com/cucumber/cucumber-jvm/blob/v1.2.0/core/src/main/java/cucumber/runtime/RuntimeOptions.java#L116). The solution would be to define your property like this:

<properties>
    <dryRun>--dry-run</dryRun>
</properties>

Unrelated to that, the opening brace before the feature path would also cause cucumber not to find the feature.

Sign up to request clarification or add additional context in comments.

1 Comment

@user2837153 thanks, if this answer solved your question you can mark it as accepted. There should be some kind of check mark on the left near the voting arrows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.