forked from geb/geb-example-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
48 lines (36 loc) · 1.29 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
apply plugin: "groovy"
apply plugin: "idea"
repositories {
mavenCentral()
}
// The drivers we want to use
ext.drivers = ["firefox", "chrome"]
dependencies {
groovy "org.codehaus.groovy:groovy-all:1.8.6"
def gebVersion = "0.7.2"
def seleniumVersion = "2.26.0"
// If using Spock, need to depend on geb-spock
testCompile "org.codehaus.geb:geb-spock:$gebVersion"
testCompile "org.spockframework:spock-core:0.6-groovy-1.8"
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile "org.codehaus.geb:geb-junit4:$gebVersion"
testCompile "junit:junit-dep:4.8.2"
// Drivers
drivers.each { driver ->
testCompile "org.seleniumhq.selenium:selenium-$driver-driver:$seleniumVersion"
}
}
drivers.each { driver ->
task "${driver}Test"(type: Test) {
testReportDir = reporting.file("$name/tests")
testResultsDir = file("$buildDir/test-results/$name")
systemProperty "geb.build.reportsDir", reporting.file("$name/geb")
systemProperty "geb.env", driver
// If you wanted to set the baseUrl in your build…
// systemProperty "geb.build.baseUrl", "http://myapp.com"
}
}
task test(overwrite: true, dependsOn: drivers.collect { tasks["${it}Test"] })
task wrapper(type: Wrapper) {
gradleVersion = '1.1'
}