In cucumber-junit library I use @CucumberOptions to define feature files location:
package com.mycompany.cucumber;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = ...,
features = "classpath:.", // my java step definitions are in package com.mycompany.cucumber
// but feature files directly in test resources
// resources/is_it_friday_yet.feature
tags = ...,
glue = ...
)
public class CucumberRunner {
}
I'm running my tests with custom gradle task cucumberTest
cucumberTest {
useJUnitPlatform()
}
After migrating to cucumber-junit-platform-engine @CucumberOptions are no longer supported.
package com.mycompany.cucumber;
import io.cucumber.junit.platform.engine.Cucumber;
@Cucumber
public class CucumberRunner {
}
I can make it work with replacing plugin, tags, glue options with properties cucumber.filter.tags, cucumber.glue, cucumber.plugin.
What about features property? It works fine if I change feature files location to match package name i.e. resources/com/mycompany/cucumber/is_it_friday_yet.feature. Still this is a simple case and I have many more test packages which are not placed in the same locations as source code and I cannot move them.