-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
166 lines (141 loc) · 5.2 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
plugins {
id 'maven'
id 'java'
id 'com.jfrog.bintray' version '1.8.4'
id 'net.researchgate.release' version '2.7.0'
id 'eclipse'
id 'org.testeditor.gradle-plugin' version '0.11'
}
// Configure the testeditor plugin
testeditor {
languageVersion '2.3.5'
xtextVersion '2.18.0'
}
description = """Testing framework for web applications using Selenium for automating browsers see https://www.seleniumhq.org/"""
apply from: 'code-style/codestyle.gradle'
task cleanScreenshotDir(type: Delete) {
description = "cleanup any screenshots written"
delete fileTree(dir: "${projectDir}/screenshots", include: "**/*.png")
}
test.dependsOn cleanScreenshotDir
def coreFixtureVersion = "4.4.0"
def seleniumJavaVersion = "3.14.0"
def commonsFixtureVersion = "1.3.3"
def webdriverManagerVersion = "3.0.0"
dependencies {
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.0'
// Testing now with JUnit5
testCompileOnly 'junit:junit:4.12'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.1.0' //For tests that needs JUnit 4.X
testCompile 'org.mockito:mockito-core:2.23.0'
// these are just added for web-fixtures
compile "org.testeditor.fixture:core-fixture:$coreFixtureVersion"
compile "org.testeditor.fixture:commons-fixture:$commonsFixtureVersion"
compile "org.seleniumhq.selenium:selenium-java:$seleniumJavaVersion"
compile 'com.paulhammant:ngwebdriver:1.1.3'
compile "io.github.bonigarcia:webdrivermanager:$webdriverManagerVersion"
compile 'com.google.code.gson:gson:2.8.2'
}
configurations.all {
resolutionStrategy {
// fail eagerly on version conflict (includes transitive dependencies)
// e.g. multiple different versions of the same dependency (group and name are equal)
// failOnVersionConflict()
// force certain versions of dependencies (including transitive)
// *append new forced modules:
force 'org.slf4j:slf4j-api:1.7.18', "org.seleniumhq.selenium:selenium-java:$seleniumJavaVersion"
}
}
sourceSets.main.resources.srcDirs = [ "src/main/java" ]
sourceSets.main.resources.includes = [ "**/*.aml" ]
/*
* code below copied from core-fixture
*/
repositories {
jcenter()
mavenCentral() // This is very important for JUnit 5 tests to execute see https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-running-unit-tests-with-gradle/
maven { url "http://dl.bintray.com/test-editor/Fixtures/" }
maven { url "http://dl.bintray.com/test-editor/maven/" }
}
group = 'org.testeditor.fixture'
sourceCompatibility = 1.10
targetCompatibility = 1.10
// show standard out during test to see logging output
test {
// enable JUnit 5 support
useJUnitPlatform()
// show standard out during test to see logging output
testLogging.showStandardStreams = true
}
jar {
manifest {
attributes 'Implementation-Title': "${project.group}.${project.name}",
'Implementation-Version': project.version
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
install {
repositories.mavenInstaller {
pom.packaging = 'jar'
}
}
release {
preTagCommitMessage = '[release]'
tagCommitMessage = '[release]'
newVersionCommitMessage = '[release] new version'
tagTemplate = 'v${version}'
}
// For a summary of failed tests at the end of test execution.
tasks.withType(Test) {
// a collection to track failedTests
ext.failedTests = []
afterTest { descriptor, result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
String failedTest = "${descriptor.className}::${descriptor.name}"
logger.debug("Adding " + failedTest + " to failedTests...")
failedTests << [failedTest]
}
}
afterSuite { suite, result ->
if (!suite.parent) { // will match the outermost suite
// logs each failed test
if (!failedTests.empty) {
logger.lifecycle("\n\n*************************************************************************************************")
logger.lifecycle("\nFailed tests:")
failedTests.each { failedTest ->
logger.lifecycle("${failedTest}")
}
}
logger.lifecycle("\n*************************************************************************************************\n")
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
publish = true
pkg {
repo = 'Fixtures'
name = project.name
userOrg = 'test-editor'
licenses = ['EPL-1.0']
vcsUrl = "https://github.com/test-editor/${project.name}.git"
version {
name = project.version
vcsTag = "v$project.version"
}
websiteUrl = 'http://testeditor.org'
}
}