-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
120 lines (86 loc) · 2.97 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
111
112
113
114
115
116
117
118
119
group 'com.sysgears.seleniumbundle'
version '1.0-SNAPSHOT'
// Groovy plugin will also apply the Java plugin
apply plugin: 'groovy'
// Allure plugin provides advanced reporting
apply plugin: 'io.qameta.allure'
// Gradle plugin allows to execute commands
apply plugin: 'application'
// tasks below will be executed if none specified
defaultTasks 'clean', 'test'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.qameta.allure:allure-gradle:2.5"
}
}
repositories {
jcenter()
}
dependencies {
compile(
// Groovy language
['org.codehaus.groovy:groovy-all:2.4.15'],
// Testing framework
['org.testng:testng:6.14.3'],
// TestNG uses Guice, but does not provide it by default
[ 'com.google.inject:guice:4.2.0'],
// Library to control web browser for tests
['com.codeborne:selenide:4.11.4'],
// Web driver for browser Safari
['org.seleniumhq.selenium:selenium-safari-driver:3.12.0'],
// HTTP client
['com.mashape.unirest:unirest-java:1.4.9'],
// Dropbox client
['com.dropbox.core:dropbox-core-sdk:3.0.7'],
// CSV reader
['org.apache.commons:commons-csv:1.5'],
// Yaml reader
['org.yaml:snakeyaml:1.21'],
// Library to take and compare screenshots
['ru.yandex.qatools.ashot:ashot:1.5.4'],
// Library to take video recordings of failed tests
['com.automation-remarks:video-recorder-testng:1.8'],
// Allure Reporting
['io.qameta.allure:allure-testng:2.6.0'],
// Logging
['ch.qos.logback:logback-classic:1.2.3'],
// driver for connection to mongodb
['org.mongodb:mongo-java-driver:3.7.1']
)
}
// Allure configuration.
allure {
autoconfigure = true
version = '2.6.0'
}
mainClassName = "com.sysgears.seleniumbundle.Main"
/**
* Runs Main class of the application and passes arguments specified in the property "command".
* E.g. "./gradlew -Pcommand="updateScreenshots".
*/
run {
args command
}
/**
* Configures test task.
*/
test {
ignoreFailures = false
// adds all system properties with the "test." prefix to system properties of application
systemProperties(System.properties.findAll { (it.key.contains("test.")) })
doFirst {
useTestNG() {
// default groups are specified in gradle.properties, but can be overwritten by task arguments,
// example: -PincludeGroups=ui,functional
// configures testng to run only specified groups
includeGroups << includedGroups
// configures testng to exclude specified groups from test run
excludeGroups << excludedGroups
// sets TestNG configuration file
suiteXmlFiles << new File(rootDir, "src/test/resources/${testngConfig}.xml")
}
}
}