-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
95 lines (78 loc) · 3.36 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
84
85
86
87
88
89
90
91
92
93
94
95
plugins {
kotlin("jvm") version "1.9.22"
id("net.serenity-bdd.serenity-gradle-plugin") version "4.0.30"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
sourceSets {
create("unitTests") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
configurations["unitTestsImplementation"].extendsFrom(configurations.runtimeOnly.get())
val unitTestsImplementation: Configuration by configurations.getting {
extendsFrom(configurations.implementation.get())
}
val serenity_version by extra("4.0.30")
val junit_platform_launcher_version = "1.10.1"
val cucumber_junit_platform_engine_version = "7.14.0"
val junit_platform_suite_version = "1.10.1"
val junit_jupiter_engine_version = "5.10.1"
val junit_vintage_engine_version = "5.10.1"
val logback_classic_version = "1.4.14"
val assertj_core_version = "3.25.1"
dependencies {
implementation(kotlin("stdlib"))
unitTestsImplementation("org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}")
unitTestsImplementation("org.junit.platform:junit-platform-suite:${junit_platform_suite_version}")
unitTestsImplementation("org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_engine_version}")
unitTestsImplementation("org.junit.vintage:junit-vintage-engine:${junit_vintage_engine_version}")
testImplementation("net.serenity-bdd:serenity-cucumber:${serenity_version}")
testImplementation("net.serenity-bdd:serenity-screenplay:${serenity_version}")
testImplementation("net.serenity-bdd:serenity-ensure:${serenity_version}")
testImplementation("org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}")
testImplementation("io.cucumber:cucumber-junit-platform-engine:${cucumber_junit_platform_engine_version}")
testImplementation("org.junit.platform:junit-platform-suite:${junit_platform_suite_version}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_engine_version}")
testImplementation("org.junit.vintage:junit-vintage-engine:${junit_vintage_engine_version}")
implementation("ch.qos.logback:logback-classic:${logback_classic_version}")
testImplementation("org.assertj:assertj-core:${assertj_core_version}")
}
val reportsDirProperty: String? by project
val unitTests = task<Test>("unitTests") {
description = "Runs unit tests."
group = "verification"
testClassesDirs = sourceSets["unitTests"].output.classesDirs
classpath = sourceSets["unitTests"].runtimeClasspath
}
tasks.test {
useJUnitPlatform()
testLogging {
outputs.upToDateWhen { false }
showStandardStreams = true
}
val reportsDirPath = reportsDirProperty ?: "reports/bdd_scenarios"
reports {
html.outputLocation = file(reportsDirPath)
junitXml.outputLocation = file("$reportsDirPath/xml")
}
}
tasks.getByName<Test>("unitTests") {
useJUnitPlatform()
testLogging {
outputs.upToDateWhen { false }
showStandardStreams = true
}
val reportsDirPath = reportsDirProperty ?: "reports/unit_tests"
reports {
html.outputLocation = file(reportsDirPath)
junitXml.outputLocation = file("$reportsDirPath/xml")
}
}
tasks.register<Exec>("runPythonScript") {
commandLine("python3", "simple-calc-test-runner.py", "--run", "scenarios", "--reports-dir", "reports")
}