-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
135 lines (121 loc) · 5.18 KB
/
build.gradle
File metadata and controls
135 lines (121 loc) · 5.18 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
plugins {
id 'java'
id 'com.adarshr.test-logger' version '3.2.0'
}
group = 'neo'
version = '1.0-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.testng:testng:6.14.3'
implementation 'org.seleniumhq.selenium:selenium-java:4.15.0'
implementation 'io.github.bonigarcia:webdrivermanager:5.6.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
implementation 'com.beust:jcommander:1.82'
implementation 'com.thoughtworks.xstream:xstream:1.4.21'
implementation 'com.google.code.gson:gson:2.13.2'
implementation 'ch.qos.logback:logback-classic:1.5.20'
implementation 'com.mysql:mysql-connector-j:8.3.0'
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
}
task testGroups(type: Test) {
useTestNG() {
suites('src/test/resources/testngGroups.xml')
}
if (project.hasProperty('browser')) {
systemProperty 'browser', "${browser}"
}
if (project.hasProperty('target')) {
systemProperty 'target', "${target}"
}
if (project.hasProperty('verifyUi')) {
systemProperty 'verifyUi', "${verifyUi}"
}
afterTest { desc, result ->
println "┌─ Тест: ${desc.className}.${desc.name}"
println "├─ Статус: ${result.resultType}"
println "└─ Длительность: ${result.endTime - result.startTime}ms"
}
afterSuite { suite, result ->
if (!suite.parent) {
println "\n" + "╔══════════════════════════════════════════════════════╗"
println "║ РЕЗУЛЬТАТЫ ТЕСТОВ ║"
println "╠══════════════════════════════════════════════════════╣"
println "║ Всего тестов: ${result.testCount}".padRight(55) + "║"
println "║ Успешно: ${result.successfulTestCount}".padRight(55) + "║"
println "║ Провалено: ${result.failedTestCount}".padRight(55) + "║"
println "║ Пропущено: ${result.skippedTestCount}".padRight(55) + "║"
println "║ Время: ${result.endTime - result.startTime}ms".padRight(55) + "║"
println "╚══════════════════════════════════════════════════════╝"
}
}
}
task testContacts(type: Test) {
useTestNG() {
suites('src/test/resources/testngContacts.xml')
}
if (project.hasProperty('browser')) {
systemProperty 'browser', "${browser}"
}
if (project.hasProperty('target')) {
systemProperty 'target', "${target}"
}
if (project.hasProperty('verifyUi')) {
systemProperty 'verifyUi', "${verifyUi}"
}
afterTest { desc, result ->
println "┌─ Тест: ${desc.className}.${desc.name}"
println "├─ Статус: ${result.resultType}"
println "└─ Длительность: ${result.endTime - result.startTime}ms"
}
afterSuite { suite, result ->
if (!suite.parent) {
println "\n" + "╔══════════════════════════════════════════════════════╗"
println "║ РЕЗУЛЬТАТЫ ТЕСТОВ ║"
println "╠══════════════════════════════════════════════════════╣"
println "║ Всего тестов: ${result.testCount}".padRight(55) + "║"
println "║ Успешно: ${result.successfulTestCount}".padRight(55) + "║"
println "║ Провалено: ${result.failedTestCount}".padRight(55) + "║"
println "║ Пропущено: ${result.skippedTestCount}".padRight(55) + "║"
println "║ Время: ${result.endTime - result.startTime}ms".padRight(55) + "║"
println "╚══════════════════════════════════════════════════════╝"
}
}
}
testlogger {
theme 'plain'
showExceptions true
showStackTraces true
showCauses true
slowThreshold 1
showSummary true
showSimpleNames false
showPassed true
showSkipped true
showFailed true
showStandardStreams true
showPassedStandardStreams true
}
//// Корневой build.gradle
//allprojects {
// group = 'neo'
// version = '1.0-SNAPSHOT'
//}
//
//subprojects {
// repositories {
// mavenCentral()
// }
//}
//
//java {
// toolchain {
// languageVersion = JavaLanguageVersion.of(11)
// }
//}