Integrate App Automate Jenkins plugin with Test Reporting frameworks
This document is an extension of Integrate BrowserStack App Automate with Jenkins document, please refer it before continuing with this document.
This document would guide you to integrate BrowserStack App Automate test results with Java - TestNG and JUnit test reporting frameworks. It is a two step process:
- Generating test reports
- Embedding test reports
Generating test reports
Follow the below steps to generate test reports.
A prerequisite for embedding test reports is that the Java project must be built with Maven and use TestNG for testing.
To configure your project:
Add the following dependencies to your pom.xml
file:
<dependency>
<groupId>com.browserstack</groupId>
<artifactId>automate-testassist</artifactId>
<version>1.1.0</version>
</dependency>
Add the following repositories to your pom.xml
file:
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
Add the following plugin to your pom.xml
file:
<build>
<plugins>
<plugin>
<groupId>com.browserstack</groupId>
<artifactId>automate-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<configuration>
<source>${jdk.source.version}</source>
<target>${jdk.target.version}</target>
<complianceLevel>${jdk.source.version}</complianceLevel>
</configuration>
<executions>
<execution>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
You must define the Maven properties, jdk.source.version
and jdk.target.version
to match your project’s Java versions.
A prerequisite for embedding test reports is that the Java project must be built with Maven and use JUnit for testing.
To configure your project:
Add the following dependencies to your pom.xml
file:
<dependency>
<groupId>com.browserstack</groupId>
<artifactId>automate-testassist</artifactId>
<version>1.1.0</version>
</dependency>
Add the following repositories to your pom.xml
file:
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
Add the following plugin to your pom.xml
file:
<build>
<plugins>
<plugin>
<groupId>com.browserstack</groupId>
<artifactId>automate-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<configuration>
<source>${jdk.source.version}</source>
<target>${jdk.target.version}</target>
<complianceLevel>${jdk.source.version}</complianceLevel>
</configuration>
<executions>
<execution>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
You must define the Maven properties, jdk.source.version
and jdk.target.version
to match your project’s Java versions.
Embedding test reports
You can configure your Jenkins CI server to embed all BrowserStack Appium reports and logs in Jenkins. The steps for embedding test reports are the same for Java JUnit and Java TestNG:
-
Click on Add post-build action in Post-build Actions:
-
Click on Publish JUnit test result report:
-
In the Test report XMLs, enter
*target/surefire-reports/TEST-*.xml
-
In the Additional test report features section, add Embed BrowserStack Report.
With this integration, you can now view the results of your Appium tests within Jenkins.
Conclusion
By following the steps outlined in this guide, you should have a seamless integration between your existing automation in Jenkins, your Appium tests and the BrowserStack device cloud. This will help you leverage all the benefits of test automation and the scale and coverage offered by BrowserStack.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!