-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.gradle
50 lines (37 loc) · 1.37 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
plugins {
id 'java'
id 'com.browserstack.gradle-sdk' version "1.1.2"
}
repositories { mavenCentral() }
dependencies {
testImplementation 'junit:junit:4.13.2'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.seleniumhq.selenium:selenium-java:4.4.0'
implementation 'io.appium:java-client:8.1.1'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'com.browserstack:browserstack-java-sdk:latest.release'
}
group = 'com.browserstack'
version = '1.0-SNAPSHOT'
description = 'junit-browserstack'
sourceCompatibility = '1.8'
def browserstackSDKArtifact = configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.find { it.name == 'browserstack-java-sdk' }
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Test) {
systemProperties = System.properties
jvmArgs += "-javaagent:${browserstackSDKArtifact.file}"
}
task sampleTest(type: Test) {
dependsOn cleanTest
useJUnit()
include 'com/browserstack/FirstTest*'
jvmArgs "-javaagent:${configurations.testRuntimeClasspath.find { it.name.contains('browserstack-java-sdk') }}"
}
task sampleLocalTest(type: Test) {
dependsOn cleanTest
useJUnit()
include 'com/browserstack/LocalTest*'
jvmArgs "-javaagent:${configurations.testRuntimeClasspath.find { it.name.contains('browserstack-java-sdk') }}"
}