Java 23
Spring Boot 3.4.3
Gradle
Cucumber 7.20.1
JUnit 5
Я добавил эти зависимости:
Код: Выделить всё
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// Add Cucumber dependencies
testImplementation 'io.cucumber:cucumber-java:7.20.1'
testImplementation "io.cucumber:cucumber-java:7.20.1"
testImplementation "io.cucumber:cucumber-spring:7.20.1"
testImplementation "io.cucumber:cucumber-junit-platform-engine:7.11.0"
testImplementation 'org.junit.platform:junit-platform-suite:1.12.0'
testImplementation 'org.junit.platform:junit-platform-engine:1.12.0'
Код: Выделить всё
@Suite
@IncludeEngines("cucumber")
@SpringBootTest
@CucumberContextConfiguration
@SelectClasspathResource("features")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.example.democucumber")
public class RunAllCucumberTests {
}
Структура проекта
Когда я запускаю gradle, у меня есть
Код: Выделить всё
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 6.
Код: Выделить всё
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-platform-suite' failed to discover tests
Код: Выделить всё
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'cucumber' failed to discover tests
Подробнее здесь: https://stackoverflow.com/questions/795 ... mber-tests
Мобильная версия