然后我使用-Dcucumber.options通过mvn命令行运行测试以覆盖我的项目的选项:
mvn -f "pom.xml" -Dcucumber.options="--plugin json:report/cucumber.json,junit:target/junitreports.xml --tags @Login" test
但是显示错误:
Data provider mismatch
Method: runScenario([Parameter{index=0, type=cucumber.api.testng.PickleEventWrapper, declaredAnnotations=[]}, Parameter{index=1, type=cucumber.api.testng.CucumberFeatureWrapper, declaredAnnotations=[]}])
Arguments: [(cucumber.api.testng.CucumberExceptionWrapper)cucumber.api.testng.CucumberExceptionWrapper@a0bf272]
答案 0 :(得分:3)
需要重复插件选项。试试这个
--plugin json:report/cucumber.json --plugin junit:target/junitreports.xml
答案 1 :(得分:0)
试试这个..
@CucumberOptions(features= {"src/test/resources/features"}, glue= {"com"},
plugin = {"pretty", "junit:target/JUNITReports/report.xml", "html:target/HTMLReports", "json:target/JSONReports/report.json"})