SETTING UP CLASSPATH VALUE IN BUILD.GRADLE
Answered
Hi All,
To run cucumber test we have to use below code snippet in build.Gradle file.
Reference: http://docs.cucumber.io/tools/java/#gradle
task cucumber() {
dependsOn assemble, compileTestJava
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = ['--plugin', 'pretty', '--glue', 'gradle.cucumber', 'src/test/resources']
}
}
}
My question is how to set Classpath values:.
1. configurations.cucumberRuntime
2. sourceSets.main.output
3. sourceSets.test.output
How and where i need to define all the properties.
Please sign in to leave a comment.
Hello,
You don't need to define them. They are taken automatically from project configuration.
I used to get error related to
So, i added below line of code to fix it.
configurations {
cucumberRuntime {
extendsFrom testRuntime
}
}
Can you please verify is it correct?
Sorry, missed that cucumberRuntime should be configured manually.
Yes, your configuration is correct.
Thanks you for reply.
I have another query Can you please have look at https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000483430-Error-Please-specify-non-empty-path-to-Cucumber-package