-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
72 lines (64 loc) · 2.08 KB
/
build.gradle.kts
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
import org.gradle.internal.os.OperatingSystem
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version ("1.8.0")
id("com.avast.gradle.docker-compose") version ("0.16.11")
}
group = "ys-e2e"
version = "1.0.2"
description = "1.0.2"
repositories {
mavenCentral()
mavenLocal()
maven { setUrl("https://jitpack.io") }
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// selenium
implementation("org.seleniumhq.selenium:selenium-java:4.8.0")
// testng
implementation("org.testng:testng:7.6.1")
// testee + reportng
implementation("com.github.hibissscus:testee:1.6.8")
}
fun Test.testNG(
desc: String, suite: String, reportngTitle: String = "test",
zip: Boolean = false, pushToSlack: Boolean = false, slackChannel: String = "test"
) {
description = desc
group = "verification"
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
reports.html.required.set(false)
reports.junitXml.required.set(false)
useTestNG {
suites(suite)
useDefaultListeners = false
listeners = setOf("testee.it.reportng.HTMLReporter")
systemProperties = mapOf(
"testee.it.reportng.title" to reportngTitle,
"testee.it.reportng.zip" to zip,
"testee.it.reportng.slack" to pushToSlack,
"testee.it.reportng.slack.token" to "xxxx-xxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx",
"testee.it.reportng.slack.channel" to slackChannel
)
}
}
tasks {
test {
testNG("run entire space e2e test suite locally", "src/test/resources/local.xml", "e2e-space-local")
}
}
tasks.register<Test>("docker") {
testNG("run entire space e2e test suite in docker", "src/test/resources/docker.xml", "e2e-space-docker", true)
}
dockerCompose {
useComposeFiles.add(
if (OperatingSystem.current() != null
&& OperatingSystem.current().toString().contains("aarch64")
) "docker-compose-arm.yml"
else "docker-compose.yml"
)
stopContainers.set(false)
isRequiredBy(tasks.getByName("docker"))
}