2012-04-12 97 views
1

我正在使用JBehave运行使用WebDriver编写的测试。 Maven被用来自动化构建过程。而现在当我运行测试时,他们失败了,即抛出超时等异常,整个构建不会中断。JBehave在发生异常时不会失败生成

下面是示例输出与例外:

pastebin

谁能告诉我为什么要建立不经过失败和如何使它失败?如果你需要更多的信息,请让我知道什么。

回答

0

在设置您org.jbehave.core.configuration.Configuration对象,添加:

myConfiguration.usePendingStepStrategy(new FailingUponPendingStep()) 
+0

这个注释不应该是不够的: @Configure(storyReporterBuilder = MyReportBuilder.class,pendingStepStrategy = FailingUponPendingStep.class) ? – Arek 2012-04-12 13:52:00

0

在项目中,我使用Maven的故障保护,插件执行测试和我遇到同样的问题。该解决方案是一个验证阶段添加到故障安全:

<plugins> 
    <plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    <executions> 
     <execution> 
     <id>failsafe-verify</id> 
     <phase>verify</phase> 
     <goals> 
      <goal>verify</goal> 
     </goals> 
     </execution> 
    </executions> 
    </plugin> 
</plugins> 
0

可在5旬,而不是真正的答案在2012年提出的问题,jBehave 4.0具有这样的Maven运行do not trigger a failure from Maven when using jBehave 4.0+的错误。

因此,如果您是在2017年或2018年通过谷歌搜索获得的,请查看票据,因为它可能包含对您问题的解答(截至2017年的这篇文章“降级到3.9.5 ...” )

相关问题