-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
83 lines (71 loc) · 2.35 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
73
74
75
76
77
78
79
80
81
82
83
plugins {
java
eclipse
idea
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(22))
}
}
repositories {
mavenCentral()
}
val allureVersion = "2.29.0"
val aspectJVersion = "1.9.22.1"
val agent: Configuration by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = true
}
defaultTasks ("clean", "test")
tasks.clean {
delete("target")
}
tasks.test {
doFirst{
jvmArgs = listOf("-javaagent:${agent.singleFile}")
}
val includedTags = System . getProperty ("includeTags")
val includedTagsSet = (includedTags!=null)
val excludedTags = System . getProperty ("excludeTags")
val excludeTagsSet = (excludedTags!=null)
if(includedTagsSet && excludeTagsSet){
useJUnitPlatform{
includeTags (includedTags)
excludeTags (excludedTags)
}
} else if (includedTagsSet && !excludeTagsSet){
useJUnitPlatform{
includeTags (includedTags)
}
} else if (!includedTagsSet && excludeTagsSet){
useJUnitPlatform{
excludeTags(excludedTags)
}
} else{
useJUnitPlatform()
}
testLogging.showStandardStreams = true
ignoreFailures = true
dependsOn(tasks.clean)
}
tasks.withType<Test> {
systemProperty("driver", System.getProperty("driver"))
systemProperty("includeTags", System.getProperty("includeTags"))
systemProperty("excludeTags", System.getProperty("excludeTags"))
systemProperty("driverArguments", System.getProperty("driverArguments"))
systemProperty("showAllureAttachments", System.getProperty("showAllureAttachments","true"))
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
}
dependencies {
agent("org.aspectj:aspectjweaver:${aspectJVersion}")
testImplementation("org.seleniumhq.selenium:selenium-java:4.26.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.3")
testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
testImplementation("io.qameta.allure:allure-junit5:$allureVersion")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("ch.qos.logback:logback-classic:1.5.12")
testImplementation("ch.qos.logback:logback-core:1.5.12")
testImplementation("org.slf4j:slf4j-simple:2.0.16")
testImplementation("commons-io:commons-io:2.18.0")
}