如何解决无法在 serenity bdd
当我尝试使用 mvn clean test 命令在 serenity bdd 项目中并行执行测试用例时
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<threadCount>3</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
<parallel>classesAndMethods</parallel>
<rerunFailingTestsCount>2</rerunFailingTestsCount>
<includes>
<include>**/*TestSuite.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<configuration>
<tags>${tags}</tags>
</configuration>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
多个浏览器正在启动,但大多数浏览器什么都不做,我在控制台上看到如下异常
java.lang.NullPointerException at cucumber.runtime.formatter.TestSourcesModel.isScenarioOutlinescenario(TestSourcesModel.java:50) at cucumber.runtime.formatter.PrettyFormatter.handleScenarioOutline(PrettyFormatter.java:170) at cucumber.runtime.formatter.PrettyFormatter.handleTestCaseStarted(PrettyFormatter.java:124) at cucumber.runtime.formatter.PrettyFormatter.access$100(PrettyFormatter.java:31) at cucumber.runtime.formatter.PrettyFormatter$4.receive(PrettyFormatter.java:65) at cucumber.runtime.formatter.PrettyFormatter$4.receive(PrettyFormatter.java:62) at cucumber.runner.EventBus.send(EventBus.java:28) at cucumber.api.TestCase.run(TestCase.java:55) at cucumber.runner.Runner.runPickle(Runner.java:80) at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140) at cucumber.runtime.junit.FeatureRunner.runchild(FeatureRunner.java:68) at cucumber.runtime.junit.FeatureRunner.runchild(FeatureRunner.java:23) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runchildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73) at cucumber.api.junit.Cucumber.runchild(Cucumber.java:118) at cucumber.api.junit.Cucumber.runchild(Cucumber.java:56) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:405) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
并且此日志消息也出现在控制台内
18:26:46.951 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
18:26:46.954 [pool-1-thread-2] DEBUG n.t.c.r.m.cucumber.CucumberParser - 找不到 Cucumber 4.2.6 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 4.2.0
18:26:46.955 [pool-1-thread-2] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
18:26:46.969 [pool-1-thread-2] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.6 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 4.2.0
18:26:46.969 [pool-1-thread-2] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
18:26:46.974 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 找不到 Cucumber 4.2.6 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 4.2.0
18:26:46.975 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 找不到 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
18:26:46.989 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.6 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 4.2.0
18:26:46.990 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
18:26:47.005 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.6 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 4.2.0
18:26:47.006 [pool-1-thread-3] DEBUG n.t.c.r.m.cucumber.CucumberParser - 没有发现 Cucumber 4.2.0 类 Cucumber.runtime.model.FeatureLoader 尝试 Cucumber 2.x.x
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。