Created
March 20, 2020 22:13
-
-
Save thomo/3198d2bce6bf9cbec285027ecf21e39d to your computer and use it in GitHub Desktop.
Run cucumber with gradle with tags support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
} | |
repositories { | |
jcenter() | |
mavenLocal() | |
} | |
def cucumberVersion = '5.5.0' | |
dependencies { | |
testImplementation "io.cucumber:cucumber-java:${cucumberVersion}" | |
} | |
configurations { | |
cucumberRuntime { | |
extendsFrom testImplementation | |
} | |
} | |
def tags = (findProperty('tags') == null) ? 'not @Ignore' : findProperty('tags') + ' and not @Ignore' | |
task cucumber() { | |
dependsOn assemble, compileTestJava | |
doLast { | |
javaexec { | |
main = "io.cucumber.core.cli.Main" | |
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output | |
args = [ | |
'--strict', | |
'--plugin', 'html:build/cucumber-report', | |
'--plugin', 'json:build/cucumber-report/cucumber.json', | |
'--plugin', 'pretty', | |
'--plugin', 'usage:cucumber-usage.json', | |
'--glue', 'hellocucumber', | |
'--tags', "${tags}", | |
'features', | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment