cucumber-junit-platform 中缺少步骤通知

Lack of step-notifications in cucumber-junit-platform

如何使用 Cucumber 和 JUnit 5(cucumber-junit-platform-engine) 设置测试步骤的显示?

以前,使用 JUnit 4 可以通过添加 Cucumber 选项 stepNotifications = true

@CucumberOptions(
stepNotifications = true,
strict = true,
features="path to feature file",
glue="path to step definition file")

强烈建议在 JUnit 5 中使用 junit-platform.properties,但我找不到相应的 属性:https://github.com/cucumber/cucumber-jvm/tree/main/junit-platform-engine#configuration-options

不幸的是,与 JUnit 4 一样,JUnit 5 的域没有任何内容可以表达 sub-test 步骤。

虽然理论上可以将步骤表示为单独的测试,但这会导致各种其他问题,例如错误计算已执行的测试、错误报告失败、并行执行的复杂性等,如 JUnit 4 所示。

详细答案:https://github.com/cucumber/cucumber-jvm/issues/2471