java.lang.illegalstateexception(如果任何junitAssert失败)

cclgggtu  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(433)

我已经编写了一些Cumber场景,并在步骤中添加了junitAssert。如果任何Assert失败,cucumber报告都会出现步骤失败,但cucumber插件也会抛出以下错误。

[error] java.lang.IllegalStateException: Cucumber did not succeed and returned error =1
[error] at com.waioeka.sbt.CucumberPlugin$.$anonfun$projectSettings$6(CucumberPlugin.scala:116)
[error] at com.waioeka.sbt.CucumberPlugin$.$anonfun$projectSettings$6$adapted(CucumberPlugin.scala:91)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)

以下是sbt的变化。。
添加了插件依赖项:

addSbtPlugin("com.waioeka.sbt" % "cucumber-plugin" % "0.3.0")

依赖项:

`lazy val qaDependencies = Seq(
"io.cucumber" % "cucumber-core" % "6.10.4" % "test",
"io.cucumber" %% "cucumber-scala" % "6.10.4" % "test",
"io.cucumber" % "cucumber-jvm" % "6.10.4" % "test",
"io.cucumber" % "cucumber-junit" % "6.10.4" % "test",
"io.cucumber" % "cucumber-java" % "6.10.4"% "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "test",
"junit" % "junit" % "4.12" % "test")`

项目设置:

`lazy val testPro= project
  .settings(name := "testPro")
  .settings(libraryDependencies ++= qaDependencies)
  .settings(crossPaths :=false)
  .enablePlugins(CucumberPlugin)
  .settings(CucumberPlugin.glues := List("com.waioeka.sbt"))
  .settings(CucumberPlugin.envProperties := Map("cucumber.execution.strict"->"true"))`

有关如何解决此问题的任何帮助。如果出现任何Assert失败,这将导致jenkins构建始终出错。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题