尝试使用JUnit 5以Serenity运行Cucumber。

当测试运行程序具有@RunWith(Cucumber.class)批注时,尽管Serenity不会记录结果,但运行测试。

当测试运行程序具有@RunWith(CucumberWithSerenity.class)时,将引发“ NoClassDefFound黄瓜/运行时/ junit / Assertions”。

我以为可能是JUnit 5,所以我切换到JUnit 4,结果也一样。

我将示例项目加载到GitHub:https://github.com/WB3Tech/Cucumber-Serenity-JUnit5

目标是构建项目,然后能够在Serenity html输出中查看Cucumber结果。

有人知道我可能会出问题的地方吗?

最佳答案

请参见https://github.com/serenity-bdd/serenity-core/#cucumber-4。我希望Serenity仅能在老式模式下使用JUnit 5。

10-02 08:45