-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
132 lines (109 loc) · 4.31 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
plugins {
id 'java'
id 'io.freefair.lombok' version "${lombokPluginVersion}"
id "io.qameta.allure" version "${allureVersion}"
id 'org.owasp.dependencycheck' version "${owaspDependencycheckPluginVersion}"
id 'com.github.ben-manes.versions' version "${dependencyUpdatesPluginVersion}"
id 'be.vbgn.ci-detect' version "${ciDetectPluginVersion}"
}
defaultTasks 'clean', 'test'
group 'org.playwright.automation'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation "com.microsoft.playwright:playwright:${playwrightVersion}"
implementation "org.jetbrains:annotations:${annotationsVersion}"
implementation "joda-time:joda-time:${jodaTimeVersion}"
implementation "org.apache.commons:commons-lang3:${commonslang3Version}"
implementation "org.apache.poi:poi:${poiVersion}"
implementation "org.apache.poi:poi-ooxml:${poiVersion}"
implementation "org.apache.poi:poi-ooxml-lite:${poOoxlSchemasVersion}"
implementation "org.apache.xmlbeans:xmlbeans:${xmlBeansVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.aventstack:extentreports:${extentReportsVersion}"
implementation "org.json:json:${jsonVersion}"
implementation "io.qameta.allure:allure-testng:${allureTestNgVersion}"
implementation "org.testng:testng:${testNGVersion}"
testImplementation "org.assertj:assertj-joda-time:${assertjJodatimeVersion}"
testImplementation "org.assertj:assertj-core:${assertjcoreVersion}"
testRuntimeOnly "org.apache.logging.log4j:log4j-api:${log4jVersion}"
testRuntimeOnly "org.apache.logging.log4j:log4j-core:${log4jVersion}"
testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
}
//------------------------------------------------------DEPENDENCY-CHECK------------------------------------------------
dependencyCheck {
failBuildOnCVSS = 7
skip = Boolean.getBoolean('owasp.skip')
cveValidForHours = ci.isCi() ? 12 : 24
suppressionFile = './suppression.xml'
}
//-----------------------------------------------------DEPENDENCY-UPDATE------------------------------------------------
dependencyUpdates {
rejectVersionIf {
!isStable(it.candidate.version) && isStable(it.currentVersion)
}
outputFormatter = 'html'
outputDir = "${buildDir}/reports/dependencyUpdates"
}
static def isStable(version) {
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any {
version.toUpperCase().contains(it)
}
def otherReleasePattern = version ==~ '^[0-9,.v-]+(-r)?$'
return stableKeyword || otherReleasePattern
}
allure {
version = "${allureTestNgVersion}"
useTestNG {
version = "${allureTestNgVersion}"
}
adapter {
autoconfigure = true
aspectjweaver = true
}
}
test {//this is the gradle task to be executed
useTestNG() { //Tells Gradle to use TestNG
// listeners << 'com.testUtilities.listeners.ExtentReportListener'
// listeners << 'com.testUtilities.listeners.AllureReportListener'
// listeners << 'com.testUtilities.listeners.AnnotationTransformer'
// if (project.hasProperty('groups')) {
// includeGroups((String) project.findProperty('groups'))
// excludeGroups 'flaky', 'oos'
// }
//
// options {
// setParallel('methods')
// setThreadCount(2)
// }
suites 'src/test/resources/testRunners/testng.xml'
outputDirectory = file("$projectDir/testNGOutput")
}
//To display the following test events
testLogging {
events "PASSED", "FAILED", "SKIPPED"
}
// finalizedBy {
// allureReport
// }
}
/**
* Note: The below command would open the Allure report for the current test
* execution in the system default browser.
* Comment/ uncomment as per requirement when running locally.
*/
//allureReport {
// finalizedBy {
// allureServe
// }
//}
//-----------------------------------------------------GIT HOOK-------------------------------------------------------
tasks.register('installLocalGitHook', Copy) {
from new File(rootProject.rootDir, 'scripts/pre-commit')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0775
}
test.dependsOn installLocalGitHook