-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
76 lines (55 loc) · 2.1 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apply plugin: 'groovy'
apply plugin: 'idea'
repositories {
mavenCentral()
}
// The drivers we want to use
def drivers = ["firefox", "chrome"]
// versions
def gebVersion = "0.6.2" //TODO: update me!
def seleniumVersion = "2.25.0"
dependencies {
groovy "org.codehaus.groovy:groovy-all:1.7.5" //TODO: update me!
compile "org.spockframework:spock-core:0.5-groovy-1.7"//TODO: update me!
// If using Spock, need to depend on geb-spock
compile "org.codehaus.geb:geb-spock:$gebVersion"
// If using JUnit, need to depend on geb-junit (3 or 4)
compile "org.codehaus.geb:geb-junit4:$gebVersion"
compile "junit:junit-dep:4.8.2"
compile "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
// Drivers
drivers.each { driver ->
compile "org.seleniumhq.selenium:selenium-$driver-driver:$seleniumVersion"
}
}
task singleTest(type: Test) {
testReportDir = file("$reportsDir/$name/tests")
testResultsDir = file("$buildDir/test-results/$name")
it.metaClass.gebReportsDir = "$reportsDir/$name/geb"
systemProperty "geb.build.reportsDir", "$reportsDir/$name/geb"
if(System.properties['geb.env'] == null){
systemProperty "geb.env", 'firefox'
}
}
drivers.each { driver ->
task "${driver}Test"(type: Test) {
testReportDir = file("$reportsDir/$name/tests")
testResultsDir = file("$buildDir/test-results/$name")
it.metaClass.gebReportsDir = "$reportsDir/$name/geb"
systemProperty "geb.build.reportsDir", "$reportsDir/$name/geb"
systemProperty "geb.env", driver
}
}
task gebIde(dependsOn: classes, type: JavaExec) {
File firebugXpi = file('firefoxExtensions/firebug-1.9.2.xpi')
File gebIdeXpi = file('firefoxExtensions/gebIDE.xpi')
systemProperty "gebIde.firebugXpi.path", firebugXpi.absolutePath
systemProperty "gebIde.ideXpi.path", gebIdeXpi.absolutePath
srcFile = file("src/main/groovy/geb/console/RunGebConsole.groovy")
inputs.file srcFile
main = 'geb.console.RunGebConsole'
classpath sourceSets.main.runtimeClasspath
}
task wrapper(type: Wrapper){
gradleVersion = '1.2'
}