Serenity BDD Overview

Introduction

Use your Serenity acceptance test to monitor, performance, and load test your websites and APIs.

Check out the Getting Started with Serenity BDD guide for a quick introduction on how to run your test cases. Also check out our Selenium overview guide to better understand how Selenium tests run on Testable in general.

This document goes into further detail on the various options provided for running Serenity BDD scenarios on Testable.

Creating a Scenario

There are two ways to create a scenario:

  1. Create a new Test Case (Create Test button on the dashboard or Test Cases -> New… on the left nav), select Selenium during step 2.
  2. Go to an existing test case and click on the Scenario tab. Click the New Scenario button and select Selenium as the scenario type.

Source

There are several ways to load your Selenium Java scenario into the Testable platform.

  1. Upload Project Source as Zip File: Upload a zip file with all source code and configuration. Code is unzipped then built and run using Maven or Gradle. See below for more details.
  2. Build Project from Version Control: Project is cloned from version control onto the test runner. Code is built and run using Maven or Gradle. See below for more details.

Integration with Testable

Serenity injects a managed WebDriver instance into your tests. When running on Testable we ensure that Serenity is configured such that the webdriver.remote.url points to the locally running Selenium server.

Your project can configure any Serenity property as either a scenario parameter (passed as a System property to your tests) or in a serenity.properties file. Certain properties will be overridden by Testable when run on one of our test runners.

No special changes are required to run a Serenity test on Testable. So feel free to use their example projects (e.g. serenity-junit-starter ) as your starting point.

Build Step

If you choose to link your Git repository or upload a source zip your code needs to be compiled and built on the test runner. We support both Gradle and Maven to do this.

Gradle Build

In your Testable scenario, set Build Tool = Gradle to build via Gradle. The default arguments are gradle clean test but you can change this. If your project has a gradlew file, Testable will use it to run Gradle. If not, the latest installed version of Gradle on the test runner will be used. All scenario parameters will be available as system properties and environment variables at runtime.

Our example project is a good place to start.

Maven Build

In your Testable scenario, set Build Tool = Maven to build via Maven. The default arguments are mvn clean verify but you can change this. If your project has a mvnw file, Testable will use it to run Maven. If not, the latest installed version of Maven on the test runner will be used. All scenario parameters will be available as system properties and environment variables at runtime.

Our example project is a good place to start.

Results and Screenshots

All test results are captured and reported back to Testable including any screenshots captured during testing.

These test results will be visible in several places.

Assertions Widget: Aggregated results are visible in the Assertions widget.

Image Details: Click the name of any image in the Images widget to see the related test result including any error traces.

Test Results: Within the Results widget (Slowest Iterations => [select an iteration]) you can see all test results that were captured as part of that iteration.