It looks like in version 1.1.3, the Cucumber class is in package
cucumber.api.junit
rather than
cucumber.junit
Changing the import statement seems to have resolved the classpath issue at least.
However, there are issues with running Cucumber JUnit tests through gradle. Further information, and a workaround using a javaexec task is given here: https://github.com/yatskevich/cucumber-jvm-gradle-javaexec. In summary, with the below task:
task cucumber() {
dependsOn assemble, compileAcceptanceJava
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output +
sourceSets.acceptance.output + sourceSets.unit.runtimeClasspath +
sourceSets.acceptance.runtimeClasspath
args = ['-f', 'junit:build/reports/test-results/cucumber.xml',
'-f', 'html:build/reports/test/cucumber-tests.html',
'--glue', 'com.paragon', 'test/acceptance/features']
}
}
}
we can now run
gradle cucumber
and generate the JUnit report.