Pular para o conteúdo principal

Upgrading to Serenity 5 and Recognising Old Code

Verified against Serenity 5.4.1. The class counts come from the released jars, and the recipe was applied to five real projects.

1. What changed, by release​

Coming fromJava neededWhat you must change
4.x (tested: 4.2.34)Java 17 (4.x classes are Java 11, 5.x classes are Java 17)Versions only. All 1,587 public classes in the core, model, JUnit, Screenplay (including WebDriver and REST), REST-assured, Cucumber and Ensure jars have the same name and package in 5.4.1. A 4.2.8 project compiled with only a version bump. Align the JUnit and Cucumber versions with Serenity's (section 3).
3.x (tested: 3.9.8)Java 17 (3.x classes are Java 8)Version bump, 511 of 1,574 classes moved (section 2), the artifact changes in section 3, and the fixes for removed API found by the compiler.
2.xJava 17The same as 3.x, plus renamed Cucumber artifacts.

Serenity 5.4.1 depends on JUnit 6.1.3 and Cucumber 8.0.4 (../references/project-setup.md).

2. Classes that moved (3.x to 5.x)​

Of the 1,574 public classes in the 3.9.8 jars: 1,051 are unchanged, 511 moved to exactly one new place, 7 have a same-named class in more than one place, 5 are gone. Many net.thucydides packages are still correct (for example net.thucydides.core.steps.ScenarioSteps, net.thucydides.core.pages.Pages, and the 47 classes in net.thucydides.core.steps that did not move): only the classes in the table moved. All of net.serenitybdd.screenplay.*, net.serenitybdd.core.pages, net.serenitybdd.junit.runners and net.thucydides.core.webdriver (except two classes) kept their packages.

Old package (3.x)New packageClasses
net.serenitybdd.corenet.serenitybdd.modelCurrentOS, IgnoredStepException, PendingStepException, SerenitySystemProperties, SkipStepException
net.serenitybdd.core.buildinfonet.serenitybdd.model.buildinfoBuildInfoProvider, BuildProperties, DriverCapabilityRecord, PropertyBasedDriverCapabilityRecord
net.serenitybdd.core.collectnet.serenitybdd.model.collectNewList, NewMap, NewSet
net.serenitybdd.core.dinet.serenitybdd.model.diDependencyInjector, ModelInfrastructure
net.serenitybdd.core.environmentnet.serenitybdd.model.environmentConfiguredEnvironment, EnvironmentSpecificConfiguration, UndefinedEnvironmentVariableException, UnknownEnvironmentException
net.serenitybdd.core.exceptionsnet.serenitybdd.model.exceptionsCausesAssertionFailure, CausesCompromisedTestFailure, NoException, SerenityManagedException, TestCompromisedException, TheErrorType, UnrecognisedException
net.serenitybdd.core.historynet.serenitybdd.model.historyClearDirectoryContents, FileSystemTestOutcomeSummaryRecorder, HistoricalFlagProvider, LeaveDirectoryContents, NewFailure, PrepareHistoryDirectory, PreviousTestOutcome, TestOutcomeSummaryRecorder
net.serenitybdd.core.i8nnet.serenitybdd.model.i8nLocalisedLabels
net.serenitybdd.core.modelnet.serenitybdd.model.modelFailureDetails, TestOutcomeName
net.serenitybdd.core.restnet.serenitybdd.model.restRestMethod, RestQuery
net.serenitybdd.core.stringsnet.serenitybdd.model.stringsFirstLine, Joiner
net.serenitybdd.core.tagsnet.serenitybdd.model.tagsEnvironmentDefinedTags
net.serenitybdd.core.timenet.serenitybdd.model.timeInternalSystemClock, Stopwatch, SystemClock
net.serenitybdd.core.webdriver.driverprovidersnet.serenitybdd.core.webdriver.servicepoolsDriverServices
net.thucydides.corenet.thucydides.modelThucydidesSystemProperty
net.thucydides.core.adaptersnet.thucydides.model.adaptersJUnitStrategy, MultiStrategyAdapter, TestFramework, TestStrategyAdapter
net.thucydides.core.adapters.legacynet.thucydides.model.adapters.legacyDefaultJUnitAdapter, DefaultJUnitStrategy
net.thucydides.core.annotationsnet.serenitybdd.annotationsAnnotatedDescription, At, BlurScreenshots, ClearCookiesPolicy, DefaultUrl, Description, DriverOptions, Feature, Fields, Issue, Issues, Managed, ManagedPages, Manual, NamedUrl, NamedUrls, Narrative, Pending, Reported, Screenshots, SectionNumber, Shared, SingleBrowser, Step, StepGroup, Steps, TestAnnotations, TestsRequirement, TestsRequirements, Title, UsePersistantStepLibraries, UserStoryCode, Version, WhenPageOpens, WithDriver, WithTag, WithTagValuesOf, WithTags
net.thucydides.core.batchesnet.thucydides.model.batchesBatchManager, BatchStrategy, SystemVariableBasedBatchManager, TestCountBasedBatchManager, UnsupportedBatchStrategyException
net.thucydides.core.configurationnet.thucydides.model.configurationBuildDirectoryProvider, FilePathParser, MavenBuildDirectory, MavenOrGradleBuildPath, SessionLocalTempDirectory, SystemPropertiesConfiguration, TimeoutConfiguration, TimeoutValue
net.thucydides.core.digestnet.thucydides.model.digestDigest
net.thucydides.core.environmentnet.thucydides.model.environmentMockEnvironmentVariables, SystemEnvironmentVariables, TestLocalEnvironmentVariables
net.thucydides.core.filesnet.thucydides.model.filesTheDirectoryStructure
net.thucydides.core.imagesnet.thucydides.model.imagesRefit, ResizableImage, ResizedImage
net.thucydides.core.issuesnet.thucydides.model.issuesIssueKeyFormat, IssueTracking, SystemPropertiesIssueTracking
net.thucydides.core.loggingnet.thucydides.model.loggingConsoleColors, ConsoleEvent, ConsoleHeading, ConsoleHeadingStyle, ConsoleLoggingListener, LoggingLevel
net.thucydides.core.matchersnet.thucydides.model.matchersBeanCollectionMatcher, BeanCountMatcher, BeanFieldMatcher, BeanMatcher, BeanMatcherAsserts, BeanMatchers, BeanPropertyMatcher, BeanUniquenessMatcher, BigDecimalValueMatcher, FileMatchers, InstantiatedBeanMatcher, MaxFieldValueMatcher, MinFieldValueMatcher, PublicThucydidesMatchers, ScreenshotHasFilenamesMatcher, SimpleValueMatcher, TestOutcomeResultsMatcher, ThucydidesMatchers
net.thucydides.core.matchers.datesnet.thucydides.model.matchers.datesBeanFields, DateCollectionContainsSameDatesMatcher, DateComparator, DateIsAfterMatcher, DateIsBeforeMatcher, DateIsBetweenMatcher, DateIsSameAsMatcher, DateMatcherFormatter, DateMatchers, DateTimeCollectionContainsSameDatesMatcher, DateTimeIsAfterMatcher, DateTimeIsBeforeMatcher, DateTimeIsBetweenMatcher, DateTimeIsCloseToAsMatcher, DateTimeIsSameAsMatcher, DateTimeIsSameTimeAsMatcher, TimeIsCloseToAsMatcher
net.thucydides.core.modelnet.thucydides.model.domainAnnotatedStoryTitle, BadgeBackground, ContextIcon, DataSet, DataSetDescriptor, DataTable, DataTableRow, Downloadables, ErrorMessageFormatter, ExternalLink, FeatureTagAsDefined, HeuristicTestResult, LastElement, ManualTestEvidence, NumericalFormatter, OutcomeCounter, PackageBasedLeafRequirements, PathElement, PathElementResolver, ReportData, ReportNamer, ReportType, RequirementCache, Rule, RuleBackground, ScenarioOutcomeCounter, Stories, TakeScreenshots, TestCaseOrder, TestClassHierarchy, TestDuration, TestFailureException, TestOutcome, TestOutcomeAnnotationReader, TestOutcomeSummary, TestResult, TestResultComparison, TestResultList, TestStep, TestTag, TestTagCache, TestTags, TestType, TitleBuilder
net.thucydides.core.model.failuresnet.thucydides.model.domain.failuresFailureAnalysis, FailureAnalysisConfiguration, RootCause
net.thucydides.core.model.featuresnet.thucydides.model.domain.featuresApplicationFeature
net.thucydides.core.model.featuretagsnet.thucydides.model.domain.featuretagsFeatureFileStrategy, FeatureTagStrategy, FeatureTitle, NoFeatureStrategy, StoryFileStrategy
net.thucydides.core.model.flagsnet.thucydides.model.domain.flagsFlag, FlagCounts, FlagProvider
net.thucydides.core.model.formattersnet.thucydides.model.domain.formattersIssueExtractor, ReportFormatter, TestCoverageFormatter
net.thucydides.core.model.resultsnet.thucydides.model.domain.resultsMergeStepResultStrategy, NextStepCompromisedStrategy, NextStepFailedStrategy, NextStepStatusTakesPriorityStrategy, NextStepWasSkippedStrategy, StepResultMergeStragegy
net.thucydides.core.model.screenshotsnet.thucydides.model.domain.screenshotsScreenshot, ScreenshotPreferencesByClass
net.thucydides.core.model.stacktracenet.thucydides.model.domain.stacktraceFailureCause, RootCauseAnalyzer, StackTraceSanitizer
net.thucydides.core.outputnet.thucydides.model.outputResultsOutput, SpreadsheetResultsOutput
net.thucydides.core.reflectionnet.thucydides.model.reflectionClassFinder, FieldFinder, FieldSetter, FieldValue, MethodFinder, StackTraceAnalyser
net.thucydides.core.releasesnet.thucydides.model.releasesReleaseManager
net.thucydides.core.reportsnet.thucydides.model.reportsAcceptanceTestFullReporter, AcceptanceTestLoader, AcceptanceTestReporter, AnsiEscapes, AsciiColors, FlagsAugmenter, FormatConfiguration, JiraUpdaterService, NumberOfThreads, OutcomeAugmenter, OutcomeFormat, OutcomeSummary, ReportGenerationFailedError, ReportLoadingFailedError, ReportOptions, ReportService, ReporterRuntime, ResultChecker, SystemReporterRuntime, TestOutcomeCounter, TestOutcomeLoader, TestOutcomeStream, TestOutcomes, TestOutcomesCompromised, TestOutcomesError, TestOutcomesFailures, ThucydidesReporter, UserStoryTestReporter
net.thucydides.core.reports.adaptorsnet.thucydides.model.reports.adaptorsAdaptorService, TestOutcomeAdaptor, UnknownAdaptor
net.thucydides.core.reports.adaptors.commonnet.thucydides.model.reports.adaptors.commonFilebasedOutcomeAdaptor
net.thucydides.core.reports.adaptors.lettucenet.thucydides.model.reports.adaptors.lettuceLettuceXUnitAdaptor
net.thucydides.core.reports.adaptors.specflownet.thucydides.model.reports.adaptors.specflowScenarioSplitter, ScenarioStep, ScenarioStepReader, SpecflowAdaptor, SpecflowScenario, SpecflowScenarioTitleLine, SpecflowTableRow
net.thucydides.core.reports.adaptors.xunitnet.thucydides.model.reports.adaptors.xunitBasicXUnitLoader, CouldNotReadXUnitFileException, DefaultXUnitAdaptor, XUnitLoader
net.thucydides.core.reports.adaptors.xunit.ionet.thucydides.model.reports.adaptors.xunit.ioXUnitFiles
net.thucydides.core.reports.adaptors.xunit.modelnet.thucydides.model.reports.adaptors.xunit.modelSkip, TestCase, TestError, TestException, TestSuite
net.thucydides.core.reports.csvnet.thucydides.model.reports.csvCSVReporter
net.thucydides.core.reports.historynet.thucydides.model.reports.historyDateProvider, ProgressSnapshot, SystemDateProvider, TestResultSnapshot
net.thucydides.core.reports.htmlnet.thucydides.model.reports.htmlContextIconFormatter, CucumberCompatibleFilter, CucumberTagConverter, DescriptionSplitter, ExampleTable, MarkdownRendering, ReportNameProvider, RequirementsFilter, ResultCounts, ResultIconFormatter, ScenarioResultCounts, TagExclusions, TagFilter, TagMatch, TestOutcomeFilter
net.thucydides.core.reports.integrationnet.thucydides.model.reports.integrationTestStepFactory
net.thucydides.core.reports.jsonnet.thucydides.model.reports.jsonAScenarioHasNoNameException, JSONConverter, JSONTestOutcomeReporter
net.thucydides.core.reports.json.gsonnet.thucydides.model.reports.json.gsonClassTypeAdapter, CollectionAdapter, FileDeserializer, FileSerializer, GsonJSONConverter, GsonPreviousOutcomeConverter, InterfaceAdapter, OptionalTypeAdapter, StackTraceElementDeserializer, StackTraceElementSerializer, ZonedDateTimeAdapter
net.thucydides.core.reports.junitnet.thucydides.model.reports.junitJUnitXMLConverter, JUnitXMLOutcomeReporter
net.thucydides.core.reports.matchersnet.thucydides.model.reports.matchersTestOutcomeMatchers
net.thucydides.core.reports.remoteTestingnet.thucydides.model.reports.remoteTestingBrowserStackLinkGenerator, LinkGenerator, RemoteTestingLinkManager
net.thucydides.core.reports.templatesnet.thucydides.model.reports.templatesFreeMarkerTemplateManager, FreemarkerReportTemplate, ReportTemplate, TemplateManager, TemplateMergeException
net.thucydides.core.reports.utilnet.thucydides.model.reports.utilCopyDirectory
net.thucydides.core.reports.xmlnet.thucydides.model.reports.xmlNotAThucydidesReportException, TestOutcomeConverter
net.thucydides.core.requirementsnet.thucydides.model.requirementsAbstractRequirementsTagProvider, AllRequirements, BaseRequirementsService, ChildrenFirstOrderedMap, ClasspathRequirementsProviderService, CoreTagProvider, CouldNotLoadRequirementsException, DefaultCapabilityTypes, DefaultRequirements, DisabledRequirementsStore, ExcludedUnrelatedRequirementTypes, FeatureFilePath, FileSystemRequirements, FileSystemRequirementsService, FileSystemRequirementsStore, FileSystemRequirementsTagProvider, JSONRequirementsTree, MultiSourceRequirementsService, OverridableTagProvider, PackageAnnotationBasedTagProvider, PackageRequirementsTagProvider, ParentRequirementProvider, ParentRequirementsProvided, PathStartsWith, ReleaseProvider, RequirementAncestry, RequirementPersister, RequirementTypesProvider, Requirements, RequirementsList, RequirementsMerger, RequirementsPath, RequirementsProvided, RequirementsProviderService, RequirementsService, RequirementsStore, RequirementsTagProvider, RequirementsTree, RootDirectory, SearchForFilesOfType, SearchForFilesWithName, SerenityTestCaseFinder, TestOutcomeRequirementsTagProvider, WindowsFriendly
net.thucydides.core.requirements.annotationsnet.thucydides.model.requirements.annotationsClassInfoAnnotations, NarrativeFinder
net.thucydides.core.requirements.classpathnet.thucydides.model.requirements.classpathAnnotatedTags, ChildElementAdder, ClassNarrative, LeafRequirementAdder, NarrativeTitle, NonLeafRequirementsAdder, PackageInfoClass, PackageInfoNarrative
net.thucydides.core.requirements.modelnet.thucydides.model.requirements.modelCustomFieldValue, Example, ExampleBuilder, FeatureBackgroundNarrative, FeatureType, LoadedNarrative, NarrativeReader, OverviewReader, Requirement, RequirementBuilderNameStep, RequirementBuilderTypeStep, RequirementDefinition, RequirementTree, RequirementTypeAt, RequirementsConfiguration
net.thucydides.core.requirements.model.cucumbernet.thucydides.model.requirements.model.cucumberAnnotatedFeature, BlankRowResultIcon, CucumberParser, DescriptionWithScenarioReferences, ExampleRowResultIcon, ExampleTableInMarkdown, FeatureFileAnaysisErrors, FeatureFileChecker, FeatureFileFinder, IdentifiedExampleTable, IdentifiedScenario, InvalidFeatureFileException, NamedExampleTable, NamedScenario, NarrativeFromCucumberComments, ReferencedExampleTable, ReferencedScenario, RenderedExampleTable, RowResultIcon, ScenarioDisplayOption, ScenarioReport, SummaryRowResultIcon, URIResource, UnknownExampleTable, UnknownScenario
net.thucydides.core.requirements.reportsnet.thucydides.model.requirements.reportsAcceptanceCriteriaRequirmentCounter, ChildRequirementCounter, CompoundDuration, ExampleOutcome, ExampleOutcomes, FileSystemRequirmentsOutcomeFactory, MultipleSourceRequirmentsOutcomeFactory, PercentageRequirementCounter, RenderMarkdown, ReportBadges, RequirementOutcome, RequirementsOutcomeFactory, RequirementsOutcomes, RequirementsOutcomesOfTypeCache, RequirementsPercentageFormatter, RequirementsProportionCounter, RequirmentCalculator, ScenarioOutcome, ScenarioOutcomes, ScenarioSummaryOutcome, SingleScenarioOutcome, SubrequirementsCount, SubrequirementsPercentageCount, SubrequirementsProportionCount
net.thucydides.core.requirements.reports.cucumbernet.thucydides.model.requirements.reports.cucumberFeatureCache, FeatureFileScenarioOutcomes, OptionalAnnotatedFeature, RenderCucumber
net.thucydides.core.requirements.treenet.thucydides.model.requirements.treeNode
net.thucydides.core.resourcesnet.thucydides.model.resourcesFileResources, ResourceCopyingError, ResourceList
net.thucydides.core.screenshotsnet.serenitybdd.annotationsBlurLevel
net.thucydides.core.screenshotsnet.thucydides.model.screenshotsScreenshotAndHtmlSource, ScreenshotException
net.thucydides.core.statisticsnet.thucydides.model.statisticsAtomicTestCount, TestCount
net.thucydides.core.statistics.servicenet.thucydides.model.statistics.serviceAnnotationBasedTagProvider, ClasspathTagProviderService, ContextTagProvider, FeatureStoryTagProvider, InjectedTagProvider, JUnitTagProviderStrategy, TagProvider, TagProviderFilter, TagProviderService, TagProviderStrategy
net.thucydides.core.stepsnet.thucydides.model.stepsAnnotatedStepDescription, ExecutedStepDescription, FailingManualTestException, MetaField, ReplaceField, ScreenplayInspector, StepArgumentWriter, StepFailure, StepFailureException, StepListener, TestFailureCause, TestSourceType, TestStatus
net.thucydides.core.steps.dinet.thucydides.model.steps.diClasspathDependencyInjectorService, DependencyInjectorService
net.thucydides.core.steps.eventsnet.serenitybdd.cucumber.eventsSetTestManualEvent
net.thucydides.core.tagsnet.thucydides.model.tagsBreadcrumbTagFilter, OutcomeTagFilter, TagConverters, TagScanner, Taggable
net.thucydides.core.utilnet.thucydides.model.utilAcronym, ConfigCache, EnvironmentVariables, FileSystemUtils, Inflection, Inflector, LocalPreferences, MultipleInflection, NameConverter, PropertiesLocalPreferences, PropertiesUtil, TagInflector, TestResources, VersionProvider
net.thucydides.core.webdrivernet.thucydides.model.webdriverConfiguration, WebdriverAssertionError

The annotations are the ones most code touches: Step, Steps, Managed, DefaultUrl, Title, Narrative, Pending, WithTag, Issue and the rest of net.thucydides.core.annotations are now in net.serenitybdd.annotations. EnvironmentVariables is in net.thucydides.model.util; EnvironmentSpecificConfiguration is in net.serenitybdd.model.environment.

Ambiguous: Story (net.serenitybdd.annotations.Story for the annotation, net.thucydides.model.domain.Story for the model class), CastMember (net.serenitybdd.screenplay.annotations.CastMember for Screenplay), Release, PathElements and TagParser: decide by what the code uses it for. Gone: the WebDriverManager integration classes (WebDriverManagerSetup, WebDriverManagerEnhancer, DefaultWebDriverManagerEnhancer; drivers are found by Selenium itself now), MergedRequirementList and RecordStepResultEvent.

Rewriting imports automatically: the fix_imports.py script in the serenity-core repository (docs/ai/skill/upgrade-checks) rewrites every class in the table (imports, fully qualified names, wildcard imports) and lists the ambiguous and removed classes it found, for a person to decide.

3. The upgrade recipe​

Each step was needed by at least one of the five tested projects.

  1. Java 17 or later for the build and the tests.
  2. Set the Serenity version everywhere it appears (serenity.version, the Maven plugin version, serenity.cucumber.version).
  3. Artifact names. serenity-cucumber4, serenity-cucumber5 and serenity-cucumber6 stopped at 2.1.2, 2.2.6 and 2.6.0: use serenity-cucumber. The JUnit 4 runner (net.serenitybdd.junit.runners.SerenityRunner) lives in serenity-junit, which a 3.x project got through serenity-core: add it, with JUnit 4.13.2, if you keep JUnit 4 tests. serenity-jbehave has no 5.x release (its last version is 1.46.0): JBehave stories need migrating to Cucumber first. Check any other serenity-* artifact on Maven Central before relying on it.
  4. Remove versions that Serenity manages. Pins that were right for the old Serenity break the new one at run time, not at compile time:
    • Cucumber: a pinned cucumber-java, cucumber-junit or an <exclusion> of cucumber-core gives NoClassDefFoundError: io/cucumber/core/eventbus/EventBus (a project with Cucumber 4.8.1 and the exclusion). Use 8.0.4, or none, and delete the exclusion.
    • REST-assured and Groovy: pinned io.rest-assured:* and org.codehaus.groovy:groovy* (Groovy 3) give Conflicting module versions. Module [groovy-xml is loaded in version 3.0.6 and you are trying to load version 4.0.29. Delete them; serenity-rest-assured brings the right ones.
    • JUnit: see the troubleshooting reference ("conflicting versions"); import the JUnit BOM.
  5. Imports. Run fix_imports.py (section 2).
  6. Configuration clean-up (../references/configuration.md):
    • Delete a drivers { mac { webdriver.chrome.driver = "src/test/resources/webdriver/..." } } block of bundled driver binaries. A 2020 chromedriver cannot drive a current Chrome, and the symptom is Could not instantiate class org.openqa.selenium.chrome.ChromeDriver ... chromedriver must be executable. With the block removed, Chrome started.
    • screenshooter=shutterbug needs the separate serenity-shutterbug artifact; otherwise the test fails with Unable to instantiate screen shooter net.serenitybdd.screenshots.shutterbug.ShutterbugScreenShooter. Delete the line (default screenshots) or add the artifact.
  7. Compile from clean: mvn clean test-compile. Without clean, Maven keeps classes compiled against the old libraries: a cucumber.api.CucumberOptions import compiled for as long as the stale class file existed, and the runner then silently ran 0 scenarios.
  8. Fix removed or renamed API (the compiler lists it). Found in the tested projects: InputField.called("x") and PageElement.called("x") (gone by 3.9.8) became InputField.withNameOrId("x") and PageElement.withNameOrId("x"). cucumber.api.CucumberOptions became io.cucumber.junit.CucumberOptions, and cucumber.api.java.en.* became io.cucumber.java.en.* (the cucumber.api package does not exist in Cucumber 8).
  9. Run the tests. Failures that remain may belong to the application under test: three of the five old projects' remaining failures were a changed page (a search box and a to-do input that no longer exist).

4. Evidence: five real projects​

Project (Serenity version)Result
REST starter with Cucumber (2.4.51)Version, serenity-cucumber6 to serenity-cucumber, 2 class references rewritten, REST-assured and Groovy pins removed: 3 of 3 scenarios pass.
Cucumber 4 starter (2.1.12)Version, 4 class references rewritten, Cucumber 4.8.1 and the exclusion replaced by 8.0.4, runner import fixed, bundled drivers removed: compiles and the 4 scenarios run in Chrome; they fail on the DuckDuckGo search box, which has changed.
Screenplay with JUnit 4 and Cucumber, todo app (3.3.0)Version, serenity-junit added, 6 class references rewritten: compiles; 4 of 10 scenarios pass, 6 fail on a to-do input that one of the sample apps no longer has.
Screenplay quickstart (3.0.2)Compiles after called became withNameOrId; the run needed the shutterbug line removed, then fails on Wikipedia's changed search box (element not interactable).
Toolshop (4.2.8)Compiles with only the version bump. Its tests were not run.

5. JUnit 4 and the old Cucumber runner still work​

You do not have to move to JUnit 5. With serenity-junit and JUnit 4.13.2, @RunWith(SerenityRunner.class) with @Steps ran on 5.4.1 (1 test passed), and so did @RunWith(CucumberWithSerenity.class) with @CucumberOptions(features = ..., glue = ...) from io.cucumber.junit (3 scenarios passed). Use the JUnit 5 extension and the JUnit Platform suite for new code (../references/cucumber.md); do not rewrite a working JUnit 4 suite only to follow it. Keep one style per project.

6. Recognising old code in generated or copied examples​

OldCurrent
import net.thucydides.core.annotations.{Step,Steps,Managed,DefaultUrl,...}net.serenitybdd.annotations.*
net.thucydides.core.util.EnvironmentVariablesnet.thucydides.model.util.EnvironmentVariables
net.serenitybdd.core.environment.EnvironmentSpecificConfigurationnet.serenitybdd.model.environment.EnvironmentSpecificConfiguration
serenity-cucumber4/5/6, cucumber.api.*serenity-cucumber, io.cucumber.*
InputField.called(..), PageElement.called(..)InputField.withNameOrId(..), PageElement.withNameOrId(..)
drivers { os { webdriver.chrome.driver = ... } } with bundled binariesnothing: leave driver selection to Serenity and Selenium
serenity-jbehave storiesno 5.x release: migrate to Cucumber
@RunWith(SerenityRunner.class)still valid with serenity-junit and JUnit 4; for JUnit 5 use @ExtendWith(SerenityJUnit5Extension.class)
net.thucydides.core.steps.ScenarioSteps, net.thucydides.core.pages.Pagesnot old: still in those packages

7. Not covered​

Gradle plugin version history, Serenity 1.x, Appium and mobile modules, the Spring, JIRA and cloud-provider modules, and Selenium 3 to 4 API changes outside Serenity's own classes.

Examples​

These files compile against Serenity 5.4.1 (Playwright examples: 5.3.11).