-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
87 lines (78 loc) · 2.93 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
plugins {
id 'java'
id "org.sonarqube" version "3.4.0.2513"
}
group 'jalasoft'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'io.cucumber', name: 'cucumber-java', version: '7.4.1'
testImplementation group: 'io.cucumber', name: 'cucumber-testng', version: '7.4.1'
testImplementation group: 'io.cucumber', name: 'cucumber-picocontainer', version: '7.4.1'
implementation group: 'io.rest-assured', name: 'rest-assured', version: '5.1.1'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.13.3'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.2'
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.0-alpha7'
implementation group: 'me.jvt.cucumber', name: 'reporting-plugin', version: '7.3.0'
}
test {
useTestNG()
setBuildNumber()
systemProperty "envId", envId
}
configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}
task executeFeatures(type: Test) {
dependsOn assemble, testClasses
doLast {
javaexec {
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'pretty',
'--plugin', 'me.jvt.cucumber.report.PrettyReports:reports',
'--plugin', 'html:reports/cucumber-reports/cucumber-report.html',
'--plugin', 'json:build/cucumber/cucumber.json',
'--plugin', 'rerun:build/cucumber/rerun.txt',
'--glue', 'com.jalasoft.wordpress',
'src/test/resources/features',
'--tags', cucumberOptions
]
}
}
}
task reExecuteFeatures(type: Test) {
dependsOn assemble, testClasses
doLast {
javaexec {
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'pretty',
'--plugin', 'me.jvt.cucumber.report.PrettyReports:reports/rerun',
'--plugin', 'html:reports/rerun/cucumber-reports/cucumber-report.html',
'--plugin', 'json:build/cucumber/rerun/cucumber.json',
'--plugin', 'rerun:build/cucumber/rerun.txt',
'--glue', 'com.jalasoft.wordpress',
'@build/cucumber/rerun.txt'
]
}
}
}
sonarqube {
properties {
property "sonar.projectKey", "wordpress-testng"
property "sonar.organization", "testng-wordpress"
property "sonar.host.url", "https://sonarcloud.io"
}
}
def setBuildNumber() {
ant.propertyfile(file: "cucumber-reporting.properties") {
entry(key: "buildNumber", value: buildNumber)
}
}