CloudBeat Docs
HomeRequest a DemoContactSign In
  • What is CloudBeat?
  • Get Started
    • Quick Start
  • SUPPORTED FRAMEWORKS
    • Java JUnit
    • .NET MSTest
    • Playwright (JS/TS)
  • Fundamentals
    • Creating Projects
    • Creating Environments
    • Creating Tests Cases
    • Running Tests Cases
    • Creating Tests Suites
    • Running Tests Suites
    • Creating Releases
    • Adding Apps
  • Sample Projects
    • Introduction to Cloudbeat sample projects
    • Oxygen Cucumber project
    • Oxygen project
    • TestNG project
  • Features
    • Integrations
      • CI/CD Pipeline
        • Jenkins
        • Azure DevOps
      • Cloud Providers
        • Genymotion
        • Applitools
        • Perfecto
    • Supported Frameworks
    • Data-Driven Testing
      • DDT - Oxygen Framework
  • CloudBeat Synthetic
    • What is CloudBeat Synthetic?
    • Creating your first monitor
    • Review general monitor results
    • Review specific monitor dashboard
    • Create SLA
    • Create Reports & Alerts
    • Changing Runtime Setting
    • Run Monitors
    • Maintenance
    • Incidents
    • Full Monitor Test - Example
  • Settings & Administration
    • Managing Notification Groups
    • Managing Permissions
    • Managing Users
    • Managing Account
    • Managing My Profile
  • References
    • Active Runs
    • Test Results
    • Projects
      • Oxygen Project
      • Cucumber + Java Project
      • .Net Project
      • TestNG Project Setup
    • Reports
Powered by GitBook
On this page
  • Installation
  • Implementing Cloudbeat Reporting
  • Creating a Java JUnit project in Cloudbeat
  • Connect your test project to CloudBeat
  • Git synchronization
  • Uploading manually
  • Running your tests
  • Running multiple tests

Was this helpful?

  1. SUPPORTED FRAMEWORKS

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:

<dependency>
    <groupId>io.cloudbeat</groupId>
    <artifactId>cb-kit-selenium4</artifactId>
    <version>LATEST</version>
</dependency>
<dependency>
    <groupId>io.cloudbeat</groupId>
    <artifactId>cb-kit-common</artifactId>
    <version>LATEST</version>
</dependency>
<dependency>
    <groupId>io.cloudbeat</groupId>
    <artifactId>cb-kit-junit5</artifactId>
    <version>LATEST</version>
</dependency>

If you want to use a specific version, include it inside properties:

<cloudbeat.version>1.0.11</cloudbeat.version>

Then instead of LATEST, use cloudbeat.version

<dependency>
    <groupId>io.cloudbeat</groupId>
    <artifactId>cb-kit-selenium4</artifactId>
    <version>${cloudbeat.version}</version>
</dependency>

For on-prem, we can install the Cloudbeat kit using files stored locally

We need to specify the version of the jar files:

<cloudbeat.version>1.0.11-SNAPSHOT</cloudbeat.version>

Then install the dependencies:

mvn clean install

Implementing Cloudbeat Reporting

We need to start by importing the Cloudbeat step extension inside our methods file:

import io.cloudbeat.common.annotation.CbStep;

Then, add CbStep above your method:

@CbStep("Open Base URL")
public void open() {
    driver.get(baseUrl);
}

Import CloudBeat Junit extension in our tests:

import io.cloudbeat.junit.CbJunitExtension;

Extend Cloudbeat JUnit extension class:

import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith({ CbJunitExtension.class })
public class LoginTest {
    private WebDriver driver;
    private LoginPage loginPage;

    @BeforeEach
    public void setUp() {
        driver = DriverManager.getDriver();
        loginPage = new LoginPage(driver);
    }
}

Wrap your test steps using startStep & endLastStep:

@Test
@DisplayName("Standard User Login Behaviour")
public void standardUserLoginBehaviour() {
    CbJunitExtension.startStep("Open Main Page");
    loginPage.open();
    loginPage.assertPageOpen();
    CbJunitExtension.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.

PreviousQuick StartNext.NET MSTest

Last updated 3 days ago

Was this helpful?