-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
139 lines (109 loc) · 3.74 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//no need in buildscript if using new standard for declaring plugins
// buildscript {
// repositories {
// jcenter()
// }
// dependencies {
// classpath "io.qameta.allure:allure-gradle:2.5"
// }
//}
//new way of declaring and applying plugins, no need in buildscript
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.0'
id 'io.qameta.allure' version '2.5'
}
apply plugin: 'io.qameta.allure'
group 'io.iljapavlovs'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile 'com.codeborne:selenide:5.0.1'
// allure selenide listener
testCompile 'io.qameta.allure:allure-selenide:2.8.1'
// testCompile 'io.qameta.allure:allure-junit4:2.8.1'
implementation('com.squareup.retrofit2:retrofit:2.5.0')
implementation('com.squareup.retrofit2:converter-gson:2.5.0')
// allure retrofit listener
implementation('io.qameta.allure:allure-okhttp3:2.8.1')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.3.2')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.3.2')
testRuntimeOnly('io.qameta.allure:allure-junit5:2.8.1')
testRuntimeOnly('org.slf4j:slf4j-simple:1.7.25')
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
//allure {
// autoconfigure = true
// version = '2.8.1'
//}
allure {
version = '2.7.0'
autoconfigure = true
aspectjweaver = true
// allureJavaVersion = '2.4.1'
clean = true
// resultsDir = new File(project.getBuildDir(), "allure-results")
// useJUnit4 {
// version = '2.7.0'
// }
// https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/2.8.1/allure-2.8.1.zip - The requested path was not found.
// downloadLink = 'https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/2.7.0/allure-2.7.0.zip'
}
test {
// junit4
// useJUnit()
// junit5
useJUnitPlatform()
testLogging.showStandardStreams = true
ignoreFailures = true
// maxParallelForks = 3 // dont need since fork count set in junit-platform.properties
// workaround for https://github.com/gradle/gradle/issues/6453
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// systemProperties['junit.jupiter.execution.parallel.enabled'] = false
// systemProperties['junit.jupiter.execution.parallel.config.strategy'] = "fixed"
// systemProperties['junit.jupiter.execution.parallel.config.fixed.parallelism'] = 3
systemProperties = [
'junit.jupiter.execution.parallel.enabled': true,
'junit.jupiter.execution.parallel.config.strategy': 'fixed',
'junit.jupiter.execution.parallel.config.fixed.parallelism': 3
]
// Setting system properties
// systemProperty 'junit.jupiter.conditions.deactivate', '*'
// systemProperties = [
// 'junit.jupiter.extensions.autodetection.enabled': 'true',
// 'junit.jupiter.testinstance.lifecycle.default': 'per_class'
// ]
forkEvery = 1
}
if (project.hasProperty('env')) {
String environment = project.getProperty('env')
def supportedEnvironments = ["acceptance", "dev"]
if (!(environment in supportedEnvironments)) {
throw new GradleException("You have defined an invalid environment '${environment}' - should be one of ${supportedEnvironments}")
}
println "Target environment: ${environment}"
switch (environment) {
case "acceptance":
test {
include("**/*AcceptanceTest.class")
}
break
default:
test {
include("**/*Test.class")
}
break
}
} else {
test {
include("**/*Test.class")
}
}