forked from BCDevOps/BDDStack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (89 loc) · 3.42 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import org.apache.tools.ant.taskdefs.condition.Os
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", "firefoxHeadless", "chrome", "chromeHeadless","ie","edge","safari"]
ext {
groovyVersion = '2.4.12'
gebVersion = '2.0'
seleniumVersion = '3.6.0'
chromeDriverVersion = '2.36'
geckoDriverVersion = '0.18.0'
ieDriverVersion = '3.6'
edgeDriverVersion = seleniumVersion
safariDriverVersion = seleniumVersion
}
}
apply from: "gradle/osSpecificDownloads.gradle"
repositories {
mavenCentral()
}
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"
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile "org.gebish:geb-junit4:$gebVersion"
//Support
testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
// Drivers
testCompile "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-ie-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-edge-driver:$seleniumVersion"
// Spock reports
testCompile( 'com.athaydes:spock-reports:1.4.0' ) {
transitive = false // this avoids affecting your version of Groovy/Spock
}
testCompile 'org.slf4j:slf4j-api:1.7.13'
testCompile 'org.slf4j:slf4j-simple:1.7.13'
}
webdriverBinaries {
chromedriver chromeDriverVersion
geckodriver geckoDriverVersion
//iedriver ieDriverVersion
}
drivers.each { driver ->
task "${driver}Test"(type: Test) {
group JavaBasePlugin.VERIFICATION_GROUP
outputs.upToDateWhen { false } // Always run tests
systemProperty "geb.build.reportsDir", reporting.file("geb/$name")
systemProperty "geb.env", driver
}
}
ieTest {
dependsOn unzipIeDriver
def iedriverFilename = Os.isFamily(Os.FAMILY_WINDOWS) ? "IEDriverServer.exe" : "IEDriverServer"
systemProperty "webdriver.ie.driver", new File(unzipIeDriver.outputs.files.singleFile, iedriverFilename).absolutePath
}
edgeTest {
dependsOn unzipEdgeDriver
def edgedriverFilename = Os.isFamily(Os.FAMILY_WINDOWS) ? "MicrosoftWebDriver.exe" : "MicrosoftWebDriver.exe"
systemProperty "webdriver.edge.driver", new File(unzipEdgeDriver.outputs.files.singleFile,edgedriverFilename).absolutePath
}
test {
dependsOn drivers.collect { tasks["${it}Test"] }
enabled = false
}
tasks.withType(Test) {
maxHeapSize = "1g"
jvmArgs '-XX:MaxMetaspaceSize=128m'
testLogging {
exceptionFormat = 'full'
}
systemProperty 'com.athaydes.spockframework.report.outputDir', 'build/reports/spock'
systemProperty 'com.athaydes.spockframework.report.internal.HtmlReportCreator.inlineCss', false
systemProperty 'com.athaydes.spockframework.report.projectName',"<Your Project Name Here>"
}
tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.memoryMaximumSize = '256m'
}