-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
93 lines (81 loc) · 2.96 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
plugins {
id 'java'
}
group = 'org.rizkiamin'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.9.1'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.13.0'
implementation 'io.github.bonigarcia:webdrivermanager:5.5.3'
testImplementation group: 'io.cucumber', name: 'cucumber-junit-platform-engine', version: '7.14.0'
testImplementation 'io.cucumber:cucumber-java:7.14.0'
testImplementation group: 'io.cucumber', name: 'cucumber-junit', version: '7.14.0'
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: '5.3.1'
implementation group: 'io.rest-assured', name: 'json-schema-validator', version: '5.3.1'
implementation 'org.json:json:20210307'
}
//test {
// useJUnitPlatform()
//}
configurations {
cucumberRunTime {
extendsFrom testImplementation
}
}
def tags = (findProperty('tags') == null) ? 'not @exclude' : findProperty('tags') + ' and not @exclude'
tasks.register('cucumber') {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRunTime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'html:reports/test-report.html',
'--plugin', 'json:reports/test-report.json',
'--plugin', 'pretty',
'--glue', 'com.redsky',
'--tags', "${tags}",
'src/test/resources'
]
}
}
}
tasks.register("api") {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRunTime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'html:reports/test-report-api.html',
'--plugin', 'json:reports/test-report-api.json',
'--plugin', 'pretty',
'--glue', 'com.redsky.api',
'--tags', "@api",
'src/test/resources/api'
]
}
}
}
tasks.register("web") {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRunTime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'html:reports/test-report-web.html',
'--plugin', 'json:reports/test-report-web.json',
'--plugin', 'pretty',
'--glue', 'com.redsky.web',
'--tags', "@web",
'src/test/resources/web'
]
}
}
}