如何使用 Main class 和 maven build 设置黄瓜

How to set up cucumber with Main class and maven build

我已经创建了一个项目,我打算使用 docker 运行 集成测试:https://github.com/navikt/bidrag-cucumber-nais

在这个项目中,我有

我愿意

不明白的问题:

from IntelliJ: when running junit tests, it will run cucumber and "regular" junit tests

IDEA 有 JUnit 4 和 JUnit 5 的 运行ners。当你在 class 路径上有任何一个时,它们就会被启用。

from maven: only junit tests with cucumber is run (junit vs junit-jupiter?)

Maven 一次只启用一个 运行ner,JUnit 4 或 JUnit 5,当存在多个时默认为更现代的版本。您正在使用 cucumber-junit,这是一个 JUnit 4 集成。考虑在 junit-jupiter 之外添加 junit-vintage。这样 JUnit 5 可以 运行 JUnit 4 测试或考虑使用 junit-platform-engine.