forked from jovistruck/BlueberryCake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
56 lines (44 loc) · 1.6 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
group 'org.jovi'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.5
repositories {
mavenCentral()
}
ext.versions = [
springboot : '1.2.0.RELEASE',
cucumber : '1.2.4',
fluentlenium: '0.10.2'
]
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11',
"info.cukes:cucumber-java:$versions.cucumber",
"info.cukes:cucumber-junit:$versions.cucumber",
'org.apache.httpcomponents:fluent-hc:4.5.1',
"org.assertj:assertj-core:3.2.0"
}
def String createCucumberOptions() {
def tags = System.getProperty("tags")
def dryRun = System.getProperty('dryRun','false')
print dryRun
print tags
// if(System.getProperty("testEnvironment")!=null && System.getProperty("testEnvironment").equalsIgnoreCase("production")) {
// if(!tags.toUpperCase().equalsIgnoreCase("@PRODUCTIONSAFE"))
// throw new GradleException("Tags found:" + tags + ". Tests not tagged as @PRODUCTIONSAFE cannot be run on production.")
// }
if (dryRun.equalsIgnoreCase("true")){
return "--tags $tags --dry-run"
}
return tags ? "--tags $tags" : ""
}
task printLinkToTestReports << {
println "Cucumber junit reports are outputed to file://$project.buildDir/reports/tests/index.html"
println "Cucumber html reports are outputed to file://$project.buildDir/reports/index.html"
}
test {
systemProperties System.getProperties()
systemProperty "cucumber.options", createCucumberOptions()
outputs.upToDateWhen { false }
}
test.dependsOn = [compileTestJava, processTestResources]
test.finalizedBy([printLinkToTestReports])