Surefire 插件报告来自 Cucumber 测试并在示例上重新运行

问题描述 投票:0回答:0

我对使用 Surefire 插件重新运行 Cucumber 失败场景的报告有疑问。 插件有标准配置

           <configuration>
                    <rerunFailingTestsCount>2</rerunFailingTestsCount>
           </configuration>

首次运行测试后会正确报告,包括场景名称和示例编号。所以场景的结果是:

  • 例子一:失败
  • 例二:通过

Surefire 触发器重新运行失败的测试运行。 但报告为

"Example #1" classname="Examples"
报告中可见的测试运行数为 3(假设测试在重新运行时通过) 没有与已经存在的匹配并且不被解释为片状。 它看起来像波纹管:


<testcase name="Login - After login session(...) - Example #1" classname="Login - After login session (...) - Examples" time="31.412">
    <failure>(...)</failure>
</testcase>

<testcase name="Login - After login session (...) - Examples - Example #2" classname="Login - After login session (...) - Examples" time="25.591"/>


<testcase name="Example #1" classname="Examples" time="12.615"/>

我从 Junit 检查了

TestIdentifier
,实际上类名是
Examples
而不是第一次运行时的名字

所以测试是第一次运行测试运行层次结构看起来像这样(基于

testIdentifier.getDisplayName()

Cucumber (engine)
Login
Login - Some login scenario
Login - Some login scenario - Examples
Login - Some login scenario - Examples - Example #1.2

但是重播是这样的

Cucumber (engine)
Login
Login - Some login scenario
Examples
Example #1.2

影响surefire报告。

黄瓜:7.11.1

万无一失:3.0.0-M9

联合:5.9.2

你有什么想法让它在不玩分析/合并报告的情况下工作吗?

我尝试过 Cucumber 7 和 Junit 5 的不同配置。

maven testing junit cucumber-jvm maven-surefire-plugin
© www.soinside.com 2019 - 2024. All rights reserved.