forked from geb/geb-example-gradle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
94 lines (76 loc) · 2.54 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
plugins {
id "idea"
id "groovy"
id "com.energizedwork.webdriver-binaries" version "1.0"
id "com.energizedwork.idea-base" version "1.2"
}
ext {
// The drivers we want to use
drivers = ["firefox", "chrome", "chromeHeadless"]
ext {
groovyVersion = '2.4.12'
gebVersion = '2.0'
seleniumVersion = '3.7.1'
chromeDriverVersion = '2.33'
geckoDriverVersion = '0.19.0'
}
baseUrl = project.hasProperty('baseUrl') ? project.getProperty('baseUrl') : ''
}
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:2.4.12'
}
}
dependencies {
// If using Spock, need to depend on geb-spock
testCompile "org.gebish:geb-spock:$gebVersion"
testCompile("org.spockframework:spock-core:1.1-groovy-2.4") {
exclude group: "org.codehaus.groovy"
}
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
// To interact with Selects, Checkboxes and other.
testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
// Drivers
testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
// Default @Unroll
//testCompile 'info.solidsoft.spock:spock-global-unroll:0.5.1'
// Extended Reports
testCompile('com.athaydes:spock-reports:1.3.2') { transitive = false }
testCompile 'org.slf4j:slf4j-api:1.7.13'
testCompile 'org.slf4j:slf4j-simple:1.7.13'
// MySql connector
testCompile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6'
}
webdriverBinaries {
chromedriver chromeDriverVersion
geckodriver geckoDriverVersion
}
drivers.each { driver ->
task "${driver}Test"(type: Test) {
group JavaBasePlugin.VERIFICATION_GROUP
outputs.upToDateWhen { false } // Always run tests
systemProperty 'com.athacom.athaydes.spockframework.report.projectName', "Vokuro"
systemProperty 'com.athaydes.spockframework.report.showCodeBlocks', true
systemProperty "geb.build.reportsDir", reporting.file("geb/$name")
systemProperty "geb.env", driver
systemProperty "geb.build.baseUrl", baseUrl
}
}
test {
dependsOn drivers.collect { tasks["${it}Test"] }
enabled = false
}
tasks.withType(Test) {
maxHeapSize = "1g"
jvmArgs '-XX:MaxMetaspaceSize=128m'
testLogging {
exceptionFormat = 'full'
}
}
tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.memoryMaximumSize = '256m'
}