Maven running cucumber specific feature files or folders

后端 未结 1 1977
暖寄归人
暖寄归人 2020-12-29 07:05

How is it possible to use the cucumber feature option from maven command line.
Of a tree full of features (tests), I\'m trying to run only individual fe

相关标签:
1条回答
  • 2020-12-29 07:29

    I changed my approach, and decided to use tags instead.
    Now, I run a command that tells me which tags to use and I make sure to put a special tag at the beginning of the feature file.
    My command now looks like:

    mvn install -Dcucumber.options="--tags @runThis --tags ~@ignore --format json-pretty:target/cucumber-report-myReport.json --format html:target/cucumber-html-report-myReport"
    

    The tag I put is @runThis and the ~@ignore is to tell cucumber not to run the @ignore tags.
    I also create a different report for each run, so Jenkins cucumber plugin can create a single report from all the different runs and they don't overwrite each other.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题