-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathbuild.gradle
More file actions
88 lines (74 loc) · 2.38 KB
/
build.gradle
File metadata and controls
88 lines (74 loc) · 2.38 KB
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
plugins {
id "java"
}
defaultTasks 'clean', 'test'
sourceSets {
main {
java {srcDir 'src'}
resources {srcDir 'src'}
}
test {
java {srcDir 'test'}
resources {srcDir 'test'}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenCentral()
}
ext {
junitVersion = '6.0.3'
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly "org.junit.platform:junit-platform-engine:$junitVersion"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junitVersion"
testImplementation 'com.codeborne:selenide-video-recorder:7.16.0'
testImplementation('org.seleniumhq.selenium:selenium-safari-driver:4.43.0') { transitive = false }
testImplementation 'org.assertj:assertj-core:3.27.7'
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.16'
}
[compileJava, compileTestJava]*.options.collect {options -> options.encoding = 'UTF-8'}
[compileJava, compileTestJava]*.options.collect {options -> options.debug = true}
tasks.withType(Test).configureEach { testTask ->
testTask.systemProperties = [
'file.encoding': 'UTF-8',
'user.country': 'TR',
'user.language': 'tr'
]
System.properties.stringPropertyNames()
.findAll { it.startsWith("selenide.") }
.forEach {
println " set ${it} to ${System.getProperty(it)}"
systemProperties[it] = System.getProperty(it)
}
jvmArgs = ['-ea', '-Xmx512m']
testTask.testLogging.showStandardStreams = true
testTask.outputs.upToDateWhen { false }
testTask.useJUnitPlatform()
testTask.testClassesDirs = testing.suites.test.sources.output.classesDirs
testTask.classpath = testing.suites.test.sources.runtimeClasspath
}
tasks.register("chrome", Test) {
systemProperties['selenide.browser'] = 'chrome'
// systemProperties['selenide.headless'] = 'true'
}
tasks.register("firefox", Test) {
systemProperties['selenide.browser'] = 'firefox'
// systemProperties['selenide.headless'] = 'true'
}
tasks.register("ie", Test) {
systemProperties['selenide.browser'] = 'ie'
}
tasks.register("edge", Test) {
systemProperties['selenide.browser'] = 'edge'
}
// You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver.
tasks.register("safari", Test) {
systemProperties['selenide.browser'] = 'safari'
}