如何解决Cucumber JUnit 平台引擎控制台故障
我最近开始使用 Cucumber JUnit 平台引擎。一切正常,代码正在运行,但是,当我尝试通过控制台运行代码时出现问题(mvn clean install -Dtest=CucumberTest)。
通过智能测试运行:
通过控制台测试运行:
从控制台中的日志角度来看,我看到测试已执行,但是,总而言之,我收到“未执行任何测试错误”。这个问题背后的原因是什么?谢谢各位
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[ERROR] Apr 28,2021 2:58:55 PM org.junit.platform.launcher.core.LauncherConfigurationParameters loadClassPathResource
[ERROR] INFO: Loading JUnit Platform configuration parameters from classpath resource [/***/IdeaProjects/cucumber-testing/target/classes/junit-platform.properties].
@ab
Scenario: Scenario21 # steps/suite2.feature:4
@isolated @ab @ac
Scenario: Scenario12 # steps/suite1.feature:9
@isolated @ab @gc
Scenario: Scenario11 # steps/suite1.feature:5
@ab
Scenario: Scenario22 # steps/suite2.feature:8
When Wait for amount of time # steps.TestSteps.waitFor()
When Wait for amount of time # steps.TestSteps.waitFor()
When Wait for amount of time # steps.TestSteps.waitFor()
When Wait for amount of time # steps.TestSteps.waitFor()
ForkJoinPool-1-worker-5
ForkJoinPool-1-worker-4
ForkJoinPool-1-worker-1
Then Check thread naming # steps.TestSteps.getThreadNaming()
Then Check thread naming # steps.TestSteps.getThreadNaming()
ForkJoinPool-1-worker-2
Then Check thread naming # steps.TestSteps.getThreadNaming()
Then Check thread naming # steps.TestSteps.getThreadNaming()
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0,Failures: 0,Errors: 0,Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.051 s
[INFO] Finished at: 2021-04-28T14:58:57+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project cucumber: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Process finished with exit code 1
我的 pom.xml 文件如下所示:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ii.Testing</groupId>
<artifactId>cucumber</artifactId>
<version>1.0.0</version>
<properties>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<cucumber.version>6.10.3</cucumber.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。