我已经使用了extentreports-cucumber4-adapter,cucumber-java(4.2.0),cucumber-core(4.2.0),cucumber-junit(4.2.0),gherkin(2.12.2),cucumber-reporting- 4.10.0,junit-3.8.1,cupicer-picocontainer-4.2.0,cucumber-extentsreport-com.vimalselvam(3.1.1)
我能够生成执行测试用例,但未生成报告。我是否需要在TestRunner文件中提供除此以外的任何特定路径 plugin = {“ com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:”},?
我无法在此处发布我的pom.xml文件
答案 0 :(得分:0)
请问您可以尝试使用黄瓜4.0.1版和类似的依赖项
Andreportreports 4.0.9以及cucumber4适配器版本1.0.7
我建议您在POM.xml中仅使用黄瓜4适配器,而不要使用Cucumber-extentsreport-com.vimalselvam(3.1.1)库
答案 1 :(得分:0)
这是pom.xml文件
org.seleniumhq.selenium
硒java
3.141.59
黄瓜
黄瓜芯
4.0.1
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>4.10.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports-cucumber4-adapter</artifactId>
<version>1.0.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>4.0.9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</build>
</project>
答案 2 :(得分:0)
问题可能是由于版本不匹配所致。您可以查看this项目,我已经以这种方式运行它。 (我已修复)