Getting Started - Serenity BDD

Follow this guide for a basic example of running your Serenity BDD tests on the Testable platform. We’re going to use one the Serenity example projects which tries out several searches at duckduckgo.com: https://github.com/serenity-bdd/serenity-junit-starter. No changes are needed to get it working on Testable.

Start by signing up and creating a new test case using the Create Test button on the dashboard.

Enter the test case name (e.g. Serenity Demo) and press Next.

Scenario

Select Selenium as the scenario type.

Selenium Scenario

Let’s use the following settings:

  1. Bindings: Selenium Java
  2. Framework: Serenity
  3. Source: Build Project from Version Control. See the detailed documentation for all the options to get our code onto Testable.

Selenium Java Settings

We will use the serenity-junit-starter project as our source.

This project performs a few different searches at duckduckgo.com. By default Serenity will also capture screenshots after each step. See the serenity-junit-starter code for more details. No changes are required to run it on Testable.

Testable runs your test scenario by cloning the repo into a directory on the test runner, running the build tool of choice (e.g. mvn clean verify or gradle clean test) in that directory and collecting the results.

And that’s it, we’ve now defined our scenario! To try it out before configuring a load test click the Smoke Test button in the upper right and watch Testable execute the scenario 1 time as 1 user. You should see all results including video of each Selenium session (1 per test file), commands, logging, assertions, screenshots, network traces, etc appear once the smoke test completes.

Next, click on the Configuration tab or press the Next button at the bottom to move to the next step.

Configuration

Now that we have the scenario for our test case we need to define a few parameters before we can execute our test:

  1. Total Virtual Users: Number of users that will execute in parallel. Each user will execute your Serenity test.
  2. Test Length: Select Iterations to have each client execute the scenario a set number of times regardless of how long it takes. Choose Duration if you want each client to continue executing the scenario for a set amount of time (in minutes).
  3. Location(s): Choose the location in which to run your test and the test runner source that indicates which test runners to use in that location to run the load test (e.g. on the public shared grid).

And that’s it! Press Start Test and watch the results start to flow in. See the new configuration guide for full details of all configuration options.

For the sake of this example, let’s use the following parameters:

Test Configuration

View Results

Once the test starts executing, Testable will distribute the work out to the selected test runners (e.g. Public Shared Grid in AWS N. Virginia).

Test Results

In each region, the test runners execute 2 virtual users each running your Serenity tests concurrently. Once each virtual user finishes if it’s been less than a minute it will sleep for 10 seconds and run it again until at least the requested 1 minute has passed.

The results will include videos, commands, screenshots, assertions, traces, performance metrics, logging, breakdown by URL, analysis, comparison against previous test runs, and more.

Check out the Serenity guide for more details on running your Serenity code on the Testable platform.

We also offer integration (Org Management -> Integration) with third party tools like New Relic. If you enable integration you can do more in depth analytics on your results there as well.

That’s it! Go ahead and try these same steps with your own scripts and feel free to contact us with any questions.