-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
83 lines (74 loc) · 2.85 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
buildscript {
dependencies{
classpath group: 'com.assertthat.plugins', name: 'assertthat-bdd-gradle-tasks', version: '1.6'
}
repositories {
mavenCentral()
}
}
plugins {
id 'java'
}
configurations {
cucumberRuntime {
extendsFrom testRuntime
}
}
dependencies {
testCompile group: 'io.cucumber', name: 'cucumber-java', version: '4.2.0'
testCompile group: 'io.cucumber', name: 'cucumber-junit', version: '4.2.0'
}
task downloadFeatures(type: FeaturesTask){
/*Jira project id e.g. 10001*/
projectId ="PROJECT_ID"
/*Optional - can be supplied as environment variable ASSERTTHAT_ACCESS_KEY*/
accessKey = "ASSERTTHAT_ACCESS_KEY"
/*Optional - can be supplied as environment variable ASSERTTHAT_SECRET_KEY*/
secretKey = "ASSERTTHAT_SECRET_KEY"
/*Optional - default ./features*/
outputFolder = "src/test/resources"
/*Optional - all features downloaded by default - should be a valid JQL*/
jql = "project = XX AND key in ('XXX-1')"
/*Optional - default automated (can be one of: manual/automated/both)*/
mode = "automated"
/*Optional - the value MUST be an instance of {@link String} or {@link java.net.URI}.*/
proxyURI = "myproxy:8080"
/*Optional - user name which will be used for proxy authentication.*/
proxyUsername = "username"
/*Optional - password which will be used for proxy authentication.*/
proxyPassword = "password"
}
task cucumber() {
dependsOn assemble, compileTestJava, downloadFeatures
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = ['--plugin', 'json:reports/cucumber.json', '--glue', 'gradle.cucumber', 'src/test/resources']
}
}
}
task submitReport(type: ReportTask){
/*Jira project id e.g. 10001*/
projectId ="PROJECT_ID"
/*Optional - can be supplied as environment variable ASSERTTHAT_ACCESS_KEY*/
accessKey = "ASSERTTHAT_ACCESS_KEY"
/*Optional - can be supplied as environment variable ASSERTTHAT_SECRET_KEY*/
secretKey = "ASSERTTHAT_SECRET_KEY"
/*Optional - the name of the run - default 'Test run dd MMM yyyy HH:mm:ss'*/
runName = "Dry Tests Run"
/*Optional - json report folder - default ./reports*/
jsonReportFolder = "reports"
/*Optional - regex to search for cucumber reports - default **.json*/
jsonReportIncludePattern = "**/cucumber.json"
/*Optional - the value MUST be an instance of {@link String} or {@link java.net.URI}.*/
proxyURI = "myproxy:8080"
/*Optional - user name which will be used for proxy authentication.*/
proxyUsername = "username"
/*Optional - password which will be used for proxy authentication.*/
proxyPassword = "password"
}
repositories {
jcenter()
}
cucumber.finalizedBy submitReport