Serenity 4.0.0 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:
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) innet.serenitybdd.annotations
- Replace
net.thucydides.core.util.EnvironmentVariables
withnet.thucydides.core.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.
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();