-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (70 loc) · 2.7 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
ext{
drivers = ['firefox', 'chrome', 'phantomJs']
}
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath "org.junit.platform:junit-platform-gradle-plugin:${junitPlatformVersion}"
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.junit.platform.gradle.plugin'
apply from: 'gradle/downloadDrivers.gradle'
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: seleniumVersion
testCompile group: 'io.netty', name: 'netty-all', version: nettyAllVersion
testCompile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: nettyTCNativeVersion
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: hamcrestVersion
testCompile group: 'net.lightbody.bmp', name: 'browsermob-core', version: browserMobVersion
testCompile group: 'ru.yandex.qatools.ashot', name: 'ashot', version: '1.5.4'
testCompile group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testCompile group: 'com.aventstack', name: 'extentreports', version: extentReportVersion
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: slfLog4JVersion
testCompile group: 'de.sstoehr', name: 'har-reader', version: harReaderVersion
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
testRuntime group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion
testCompile group: 'org.junit.platform', name: 'junit-platform-console-standalone', version: junitPlatformVersion
}
sourceSets {
test {
resources {
srcDirs = ['src/resources']
}
}
}
drivers.each { driver ->
task "${driver}Test"(type: JavaExec) {
systemProperty "env", System.getProperty("env")
classpath = project.sourceSets.test.runtimeClasspath
main 'org.junit.platform.console.ConsoleLauncher'
args '--scan-class-path'
args "--reports-dir=${buildDir}/junit-results"
}
}
firefoxTest {
dependsOn unzipGeckoDriver
systemProperty "webdriver.gecko.driver", unzipGeckoDriver.driverPath
systemProperty "browser", "firefox"
}
chromeTest {
dependsOn unzipChromeDriver
systemProperty "webdriver.chrome.driver", unzipChromeDriver.driverPath
systemProperty "browser", "chrome"
}
phantomJsTest {
dependsOn unzipPhantomJs
systemProperty "phantomjs.binary.path", unzipPhantomJs.driverPath
systemProperty "browser", "phantomjs"
}