forked from autotests-cloud/qa_guru_4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (92 loc) · 2.72 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
import org.gradle.api.tasks.testing.logging.TestLogEvent
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'io.qameta.allure' version '2.8.1'
}
ext.junitVersion = '5.7.0'
ext.allureVersion = '2.13.8'
allure {
version = allureVersion
autoconfigure = true
aspectjweaver = true
configuration = "testImplementation"
useJUnit5 {
version = allureVersion
}
}
repositories {
mavenCentral()
}
sourceSets {
test {
java {
srcDirs = ['src/test']
}
resources {
srcDirs = ['src/test/resources']
}
}
}
dependencies {
testImplementation([
'com.codeborne:selenide:5.19.0',
'org.junit.jupiter:junit-jupiter-api:' + junitVersion,
'io.qameta.allure:allure-java-commons:' + allureVersion,
'org.hamcrest:hamcrest-all:1.3'
])
testRuntimeOnly([
'org.junit.jupiter:junit-jupiter-engine:' + junitVersion,
'org.slf4j:slf4j-api:1.7.30',
'ch.qos.logback:logback-classic:1.2.3'
])
}
test {
useJUnitPlatform()
}
tasks.withType(Test) {
// environment 'DOCKER_CONFIG', dockerConfigDir
if (project.hasProperty("verbose.tests")) {
testLogging {
exceptionFormat "full"
def formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
beforeTest { descriptor ->
logger.lifecycle(formatter.format(new Date()) + " : STARTED : " + descriptor.getClassName() + "." + descriptor.getName())
}
afterTest { descriptor, result ->
logger.lifecycle(formatter.format(new Date()) + " : " + result.getResultType() + " : " + descriptor.getClassName() + "." + descriptor.getName())
}
}
} else {
testLogging {
exceptionFormat "full"
}
}
}
task positiveTests(type: Test) {
testLogging.events.addAll([TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_ERROR])
useJUnitPlatform {
includeTags 'Positive'
}
}
task negativeTests(type: Test) {
testLogging.events.addAll([TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_ERROR])
useJUnitPlatform {
includeTags 'Negative'
}
}
task simpleTests(type: Test) {
testLogging.events.addAll([TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_ERROR])
useJUnitPlatform {
filter {
includeTestsMatching "SimpleTests"
}
}
}
task searchTests(type: Test) {
useJUnitPlatform {
filter {
includeTestsMatching "SearchTests"
}
}
}