TestNG Project Setup

Description on how to prepare a TestNG project to be used in CloudBeat

Plugin Integration

Add the cb-framework-plugin-testng plugin to your project. For Maven base projects, this requires adding plugin repository and the plugin dependency.

Gradle based projects are not currently supported .

First add the repository to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
  </repositories>

And add the plugin dependency itself:

<dependency>
    <groupId>com.github.oxygenhq</groupId>
    <artifactId>cb-framework-plugin-testng</artifactId>
    <version>0.10.1</version>
</dependency>

In addition, if running multiple parallel tests is required, maven surefire plugin with version equal or higher than 2.22.0 should be added to the plugins section:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.22.0</version>
    </plugin>
  </plugins>
</build>

Code Level Integration

Add plugin listener to your test class and extend the test class from CbTestNg

Working with Selenium

When using Selenium it might be beneficiary to be able to take browser screenshots in case of failures.

Providing WebDriver instance

Custom steps

In order for CloudBeat to produce nicer repots, startStep and endStep methods can be used to designate test actions

Last updated

Was this helpful?