This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle.kts
56 lines (46 loc) · 1.65 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
import com.moowork.gradle.node.yarn.YarnTask
plugins {
id("com.cognifide.aem.common")
id("com.github.node-gradle.node")
}
apply(from = rootProject.file("test/common.gradle.kts"))
description = "Example - Functional Tests"
tasks {
val args by lazy {
mutableListOf<String>().apply {
aem.prop.string("test.publishUrl")?.let { addAll(listOf("-c", "baseUrl=$it")) }
if (aem.prop.flag("test.headed")) add("--headed")
if (aem.prop.flag("test.record")) add("--record")
aem.prop.string("test.spec")?.let { add("--spec=$it")}
aem.prop.string("test.browser")?.let { if (it != "auto") add("--browser=$it")}
}
}
val reportDir = "build/cypress/reports"
register<YarnTask>("runTests") {
group = "check"
description = "Run functional tests (Cypress)"
dependsOn("yarn")
mustRunAfter(":env:environmentAwait")
finalizedBy("generateReport")
setWorkingDir(projectDir)
setYarnCommand("cypress")
setArgs(listOf("run") + args)
doFirst { delete(reportDir) }
}
register<YarnTask>("generateReport") {
group = "check"
description = "Generate report for functional tests (Cypress)"
setWorkingDir(projectDir)
setYarnCommand("node")
setArgs(listOf("scripts/generateReport.js"))
}
register<YarnTask>("openGui") {
group = "check"
description = "Open functional tests GUI runner (Cypress)"
dependsOn("yarn")
setWorkingDir(projectDir)
setYarnCommand("cypress")
setArgs(listOf("open") + args)
doFirst { delete(reportDir) }
}
}