Java JUnit
This example project shows how to run JUnit tests in Java with Cloudbeat integration. It’s a simple way to get started with running your tests in the cloud and viewing results in real time.
Installation
First we need to include the Cloudbeat dependencies inside our pom.xml:
If you want to use a specific version, include it inside properties:
Then instead of LATEST, use cloudbeat.version
We need to specify the version of the jar files:
Then install the dependencies:
Implementing Cloudbeat Reporting
We need to start by importing the Cloudbeat step extension inside our methods file:
Then, add CbStep above your method:
Import CloudBeat Junit extension in our tests:
Extend Cloudbeat JUnit extension class:
Wrap your test steps using startStep & endLastStep:
Creating a Java JUnit project in Cloudbeat
Under Manage, open projects and click on add project, choose a name and select Java JUnit.
Connect your test project to CloudBeat
CloudBeat is a platform for both test reporting and execution. To use CloudBeat, you must upload your test project files to execute tests and access report analytics. You can upload your project as a Zip file, or CloudBeat can automatically synchronize with your test project Git repository.
Git synchronization
In order to sync your test project from git, select Git Integration and paste the url to your repository.
You can use your username and password, or with an access token.
Uploading manually
If you want to upload a local test project, you need to zip your project folder, then select upload.
Running your tests
Under Testing, go to cases and you will see all your tests. Under each test you will find multiple options such as choosing who will receive notifications for this test, schedule when the test will run, choosing environments and parameters and the browser it will run on.
Click on Run Now to execute the test, then the results will appear under the Results tab.
To expend the results and see all the steps, data, logs and errors, click on case summary:
Running multiple tests
Under Testing, go to Suites, right-click on Dashboard to create a new suite, or start by creating a new folder then right-click on it and choose Create suites - web.
Similarly to single tests, select your browser and other configurations:
Select your desired tests:
Click on Save Changes and then Run Now. The results will wait for you under the results tab.
Last updated
Was this helpful?