-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
106 lines (88 loc) · 3.03 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
94
95
96
97
98
99
100
101
plugins {
id 'java'
}
group = 'org.fajarb'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
// api automation
testImplementation group: 'io.rest-assured', name: "rest-assured", version: '4.5.1'
implementation group: 'org.json', name: 'json', version: '20230227'
testImplementation group: 'io.rest-assured', name: 'json-schema-validator', version: '4.5.1'
// fix error slf4j
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'ch.qos.logback:logback-classic:1.2.9'
// web automation
implementation 'org.seleniumhq.selenium:selenium-java:4.9.0'
implementation 'io.github.bonigarcia:webdrivermanager:5.3.2'
implementation 'io.cucumber:cucumber-java:7.11.2'
testImplementation 'io.cucumber:cucumber-junit:7.11.2'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
//test {
// useJUnitPlatform()
//}
configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}
//def tags = (findProperty('tags') == null) ? 'not @exclude' : findProperty('tags') + ' and not @exclude'
//
//task cucumber() {
// description("Running Cucumber Test")
// dependsOn assemble, compileTestJava
// doLast {
// javaexec {
// main = "io.cucumber.core.cli.Main"
// classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
// args = [
// '--plugin', 'html:reports/index.html',
// '--plugin', 'json:reports/index.json',
// '--plugin', 'pretty',
// '--glue', 'com.fajarb',
// '--tags', "${tags}",
// 'src/test/resources'
// ]
// }
// }
//}
task web() {
description("Running Cucumber for Web UI Test")
dependsOn assemble, compileTestJava
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'html:reports/report-web.html',
'--plugin', 'json:reports/report-web.json',
'--plugin', 'pretty',
'--glue', 'com.fajarb',
'--tags', "@web",
'src/test/resources/web'
]
}
}
}
task api() {
description("Running Cucumber for API Test")
dependsOn assemble, compileTestJava
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'html:reports/report-api.html',
'--plugin', 'json:reports/report-api.json',
'--plugin', 'pretty',
'--glue', 'com.fajarb',
'--tags', "@api",
'src/test/resources/api'
]
}
}
}