-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
77 lines (61 loc) · 1.89 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"
apply plugin: "war"
apply plugin: "jetty"
buildscript {
repositories {
mavenCentral()
maven {
url "https://repository-saucelabs.forge.cloudbees.com/release"
}
}
dependencies {
classpath "com.saucelabs:sauce-connect:3.0.24"
classpath("com.saucelabs:ci-sauce:1.29") {
transitive = false
}
classpath "commons-io:commons-io:1.4"
classpath "commons-lang:commons-lang:2.6"
}
}
def sauce = [
username: System.getProperty('sauce.username'),
apiKey: System.getProperty('sauce.apiKey')
]
jettyRun.contextPath = '/'
jettyRun.webAppSourceDirectory = new File('src/test/javascript')
stopPort = 8090
stopKey = '123'
repositories {
mavenCentral()
}
dependencies {
groovy "org.codehaus.groovy:groovy-all:2.1.1"
testCompile "org.gebish:geb-spock:0.9.0-RC-1"
testCompile "org.spockframework:spock-core:0.7-groovy-2.0"
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:2.26.0"
}
task gebTest(type: Test) {
testReportDir = reporting.file("$name/tests")
testResultsDir = file("$buildDir/test-results/$name")
systemProperty 'geb.build.reportsDir', reporting.file("$name/geb")
systemProperty 'geb.env', System.getProperty('geb.env')
systemProperty 'sauce.username', sauce.username
systemProperty 'sauce.apiKey', sauce.apiKey
}
task test(overwrite: true, dependsOn: [tasks['gebTest']])
task wrapper(type: Wrapper) {
gradleVersion = '1.4'
}
gebTest.doFirst {
jettyRun.daemon = true
jettyRun.execute()
if(sauce.username && sauce.apiKey) {
sauce.connect = new com.saucelabs.ci.sauceconnect.SauceConnectTwoManager()
sauce.connect.openConnection(sauce.username, sauce.apiKey, 4445, null, null, null, null)
}
}
gebTest.doLast {
tasks.jettyStop.execute()
sauce.connect?.closeTunnelsForPlan(sauce.username, null)
}