Skip to content

Commit 44053e2

Browse files
committed
updated README.md and cucumber version bump
1 parent 0880a51 commit 44053e2

File tree

3 files changed

+50
-11
lines changed

3 files changed

+50
-11
lines changed

README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,57 @@
33

44
[Cucumber JVM](https://cucumber.io/docs/reference/jvm) Integration with BrowserStack.
55

6-
## Setup
7-
* Clone the repo
8-
* Install dependencies `mvn install`
9-
* Set environment variables with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings).
10-
* Update `*.conf.js` files inside the `src/test/resources/conf/` directory to update desired capabilities.
6+
## Using Maven
117

12-
## Running your tests
13-
* To run a single test, run `mvn test -P single`
14-
* To run parallel tests, run `mvn test -P parallel`
15-
* To run local tests, run `mvn test -P local`
8+
### Run sample build
169

10+
- Clone the repository
11+
- Install dependencies `mvn compile`
12+
- To run the test suite having cross-platform with parallelization, run `mvn test -P sample-test`
13+
- To run local tests, run `mvn test -P sample-local-test`
1714

15+
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
16+
17+
### Integrate your test suite
18+
19+
* Install dependencies `mvn compile`
20+
* Create sample browserstack.yml file with the browserstack related capabilities with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings) and place it in your root folder.
21+
* Add maven dependency of browserstack-java-sdk in your pom.xml file
22+
```sh
23+
<dependency>
24+
<groupId>com.browserstack</groupId>
25+
<artifactId>browserstack-java-sdk</artifactId>
26+
<version>LATEST</version>
27+
<scope>compile</scope>
28+
</dependency>
29+
```
30+
* Modify your build plugin to run tests by adding argLine `-javaagent:${com.browserstack:browserstack-java-sdk:jar}` and `maven-dependency-plugin` for resolving dependencies in the profiles `sample-test` and `sample-local-test`.
31+
```
32+
<plugin>
33+
<artifactId>maven-dependency-plugin</artifactId>
34+
<executions>
35+
<execution>
36+
<id>getClasspathFilenames</id>
37+
<goals>
38+
<goal>properties</goal>
39+
</goals>
40+
</execution>
41+
</executions>
42+
</plugin>
43+
<plugin>
44+
<groupId>org.apache.maven.plugins</groupId>
45+
<artifactId>maven-surefire-plugin</artifactId>
46+
<version>3.0.0-M5</version>
47+
<configuration>
48+
<suiteXmlFiles>
49+
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
50+
</suiteXmlFiles>
51+
<argLine>
52+
-javaagent:${com.browserstack:browserstack-java-sdk:jar}
53+
</argLine>
54+
</configuration>
55+
</plugin>
56+
```
1857

1958
## Notes
2059
* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)

browserstack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ accessKey: YOUR_ACCESS_KEY
1616
# Ensure you add a dynamic identifier, like an incremental build number from your
1717
# CI/CD or timestamp at the end of every build; otherwise tests from different
1818
# executions will be grouped together on BrowserStack
19-
buildName: browserstack-build-124
19+
buildName: browserstack-build-1
2020
# Use `projectName` to set the name of your project. Example, Marketing Website
2121
projectName: BrowserStack Samples
2222

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<maven.compiler.source>1.8</maven.compiler.source>
1616
<maven.compiler.target>1.8</maven.compiler.target>
17-
<cucumber.version>6.9.1</cucumber.version>
17+
<cucumber.version>7.4.1</cucumber.version>
1818
<testng.version>7.4.0</testng.version>
1919
<selenium-java.version>3.141.59</selenium-java.version>
2020
<browserstack-local-java.version>1.0.6</browserstack-local-java.version>

0 commit comments

Comments
 (0)