Skip to content

v4.0.1

Latest
Compare
Choose a tag to compare
@globalworming globalworming released this 10 Jan 10:32
· 369 commits to main since this release

Serenity 4 Release Notes

Serenity 4.0.1 is a major upgrade. The most significant change is updating the library to support Java 11, in line with other popular testing libraries such as Selenium and Mockito. However, the migration to Java 11 requires changes in the module structure, which requires some breaking changes to the package structure.

These release notes will explain how to update your project to work with Serenity BDD 4.x.

The biggest change is the main Serenity annotations, such as @Step, which are now in the net.serenitybdd.annotations package, rather than the net.thucydides.core.annotations package as was previously the case.

If you are using Serenity internal classes, some of these may have moved as well.

The following table indicates the main changes:

Package changes

Module Old packages New Packages
serenity-screenplay-webdriver net.serenity.screenplay.* net.serenity.screenplay.webdriver.*
net.serenitybdd.screenplay.webtest.actions.* net.serenitybdd.screenplay.webdriver.actions.*
serenity-model net.serenitybdd.core.* net.serenitybdd.model.*
net.thucydides.core.annotations.* net.serenitybdd.annotations.*
Other net.thucydides.core.* net.thucydides.model.*

For example:

  • Replace any annotations previously in net.thucydides.core.annotations (e.g. @step) in net.serenitybdd.annotations
  • Replace net.thucydides.core.util.EnvironmentVariables with net.thucydides.model.util.EnvironmentVariables

This release also includes support for Selenium 4.11.0, a number of bug fixes, and improved support of reporting step durations for parallel tests.

Guice is no longer used

Serenity stopped using Guice in version 3.9.8. This has no impact on most test scripts, but if you are using internal classes such as net.thucydides.core.guice.Injectors classes to retrieve objects such as EnvironmentVariables, this will no longer work. In Serenity 4.0.0 or higher, to retrieve the current environment variables, use the net.serenitybdd.core.di.SerenityInfrastructure class as shown here:

EnvironmentVariables environmentVariables = SerenityInfrastructure.getEnvironmentVariables();

Report Generation Changes

In Serenity 4.0.x, test execution generates JSON test output files, but not HTML files. To generate the full HTML reports, invoke the aggregate task, e.g. mvn aggregate or gradle aggregate.