Skip to content

Commit 3752e1c

Browse files
committed
added gradle config
1 parent 44053e2 commit 3752e1c

File tree

2 files changed

+64
-22
lines changed

2 files changed

+64
-22
lines changed

build.gradle

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
mavenLocal()
8+
google()
9+
}
10+
11+
dependencies {
12+
implementation 'io.cucumber:cucumber-jvm:7.4.1'
13+
implementation 'commons-io:commons-io:1.3.2'
14+
implementation 'org.seleniumhq.selenium:selenium-java:3.141.59'
15+
implementation 'com.browserstack:browserstack-local-java:1.0.6'
16+
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
17+
testImplementation 'io.cucumber:cucumber-java:7.4.1'
18+
testImplementation 'io.cucumber:cucumber-testng:7.4.1'
19+
compileOnly 'com.browserstack:browserstack-java-sdk:latest.release'
20+
}
21+
22+
group = 'com.browserstack'
23+
version = '1.0-SNAPSHOT'
24+
description = 'cucumber-java-browserstack'
25+
sourceCompatibility = '1.8'
26+
27+
def browserstackSDKArtifact = configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.find { it.name == 'browserstack-java-sdk' }
28+
29+
tasks.withType(JavaCompile) {
30+
options.encoding = 'UTF-8'
31+
}
32+
33+
task sampleTest(type: Test) {
34+
useTestNG() {
35+
systemProperty "cucumber.publish.quiet", "true"
36+
systemProperty "cucumber.features", "src/test/resources/features/test"
37+
dependsOn cleanTest
38+
useDefaultListeners = true
39+
suites "src/test/resources/testng.xml"
40+
jvmArgs "-javaagent:${browserstackSDKArtifact.file}"
41+
}
42+
}
43+
44+
task sampleLocalTest(type: Test) {
45+
useTestNG() {
46+
systemProperty "cucumber.publish.quiet", "true"
47+
systemProperty "cucumber.features", "src/test/resources/features/localtest"
48+
dependsOn cleanTest
49+
useDefaultListeners = true
50+
suites "src/test/resources/testng.xml"
51+
jvmArgs "-javaagent:${browserstackSDKArtifact.file}"
52+
}
53+
}

pom.xml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@
8282
<target>8</target>
8383
</configuration>
8484
</plugin>
85+
<plugin>
86+
<artifactId>maven-dependency-plugin</artifactId>
87+
<executions>
88+
<execution>
89+
<id>getClasspathFilenames</id>
90+
<goals>
91+
<goal>properties</goal>
92+
</goals>
93+
</execution>
94+
</executions>
95+
</plugin>
8596
</plugins>
8697
</build>
8798
<profiles>
@@ -92,17 +103,6 @@
92103
</activation>
93104
<build>
94105
<plugins>
95-
<plugin>
96-
<artifactId>maven-dependency-plugin</artifactId>
97-
<executions>
98-
<execution>
99-
<id>getClasspathFilenames</id>
100-
<goals>
101-
<goal>properties</goal>
102-
</goals>
103-
</execution>
104-
</executions>
105-
</plugin>
106106
<plugin>
107107
<groupId>org.apache.maven.plugins</groupId>
108108
<artifactId>maven-surefire-plugin</artifactId>
@@ -127,17 +127,6 @@
127127
<id>sample-local-test</id>
128128
<build>
129129
<plugins>
130-
<plugin>
131-
<artifactId>maven-dependency-plugin</artifactId>
132-
<executions>
133-
<execution>
134-
<id>getClasspathFilenames</id>
135-
<goals>
136-
<goal>properties</goal>
137-
</goals>
138-
</execution>
139-
</executions>
140-
</plugin>
141130
<plugin>
142131
<groupId>org.apache.maven.plugins</groupId>
143132
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)