java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
net.serenitybdd.junit.runners.SerenityRunner
- All Implemented Interfaces:
net.thucydides.model.tags.Taggable,org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Orderable,org.junit.runner.manipulation.Sortable
@Deprecated(since="5.0.0",
forRemoval=true)
public class SerenityRunner
extends org.junit.runners.BlockJUnit4ClassRunner
implements net.thucydides.model.tags.Taggable
Deprecated, for removal: This API element is subject to removal in a future version.
JUnit 4 support is deprecated and will be removed in Serenity 6.0.0.
Please migrate to JUnit 5 using SerenityJUnit5Extension. JUnit 5 has been
stable since 2017 and offers superior parallel execution, modern extension
model, and better IDE support. See the Serenity documentation for migration guidance.
A test runner for WebDriver-based web tests. This test runner initializes a
WebDriver instance before running the tests in their order of appearance. At
the end of the tests, it closes and quits the WebDriver instance.
The test runner will by default produce output in XML and HTML. This
can extended by subscribing more reporter implementations to the test runner.
- Author:
- johnsmart
-
Constructor Summary
ConstructorsConstructorDescriptionSerenityRunner(Class<?> klass) Deprecated, for removal: This API element is subject to removal in a future version.SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory) Deprecated, for removal: This API element is subject to removal in a future version.SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory, net.thucydides.core.webdriver.DriverConfiguration configuration) Deprecated, for removal: This API element is subject to removal in a future version.SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory, net.thucydides.core.webdriver.DriverConfiguration configuration, net.thucydides.model.batches.BatchManager batchManager) Deprecated, for removal: This API element is subject to removal in a future version.SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebdriverManager webDriverManager, net.thucydides.core.webdriver.DriverConfiguration configuration, net.thucydides.model.batches.BatchManager batchManager) Deprecated, for removal: This API element is subject to removal in a future version.SerenityRunner(Class<?> klass, net.thucydides.model.batches.BatchManager batchManager) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated, for removal: This API element is subject to removal in a future version.protected org.openqa.selenium.WebDriverdriverFor(org.junit.runners.model.FrameworkMethod method) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected net.thucydides.model.batches.BatchManagerDeprecated, for removal: This API element is subject to removal in a future version.Batch Manager used for running tests in parallel batchesprotected net.thucydides.core.webdriver.DriverConfigurationDeprecated, for removal: This API element is subject to removal in a future version.The Configuration class manages output directories and driver types.protected Collection<net.thucydides.model.reports.AcceptanceTestReporter>Deprecated, for removal: This API element is subject to removal in a future version.protected org.openqa.selenium.WebDriverDeprecated, for removal: This API element is subject to removal in a future version.protected org.openqa.selenium.WebDriverDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.net.thucydides.core.pages.PagesgetPages()Deprecated, for removal: This API element is subject to removal in a future version.protected JUnitStepListenerDeprecated, for removal: This API element is subject to removal in a future version.The Step Listener observes and records what happens during the execution of the test.List<net.thucydides.model.domain.TestOutcome>Deprecated, for removal: This API element is subject to removal in a future version.Find the current set of test outcomes produced by the test execution.protected JUnitStepListenerDeprecated, for removal: This API element is subject to removal in a future version.protected JUnitStepListenerinitListenersUsing(net.thucydides.core.pages.Pages pageFactory) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected voidinjectAnnotatedPagesObjectInto(Object testCase) Deprecated, for removal: This API element is subject to removal in a future version.Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.protected voidinjectDriverInto(Object testCase) Deprecated, for removal: This API element is subject to removal in a future version.Instantiate the @Managed-annotated WebDriver instance with current WebDriver.protected voidinjectEnvironmentVariablesInto(Object testCase) Deprecated, for removal: This API element is subject to removal in a future version.protected voidinjectScenarioStepsInto(Object testCase) Deprecated, for removal: This API element is subject to removal in a future version.Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.protected org.junit.runners.model.StatementmethodInvoker(org.junit.runners.model.FrameworkMethod method, Object test) Deprecated, for removal: This API element is subject to removal in a future version.Running a unit test, which represents a test scenario.protected voidDeprecated, for removal: This API element is subject to removal in a future version.voidrun(org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.Runs the tests in the acceptance test case.protected voidrunChild(org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.protected voidsetStepListener(JUnitStepListener stepListener) Deprecated, for removal: This API element is subject to removal in a future version.voidsubscribeReporter(net.thucydides.model.reports.AcceptanceTestReporter reporter) Deprecated, for removal: This API element is subject to removal in a future version.To generate reports, different AcceptanceTestReporter instances need to subscribe to the listener.voiduseQualifier(String qualifier) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, possiblyExpectingExceptions, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutMethods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolationMethods inherited from class org.junit.runner.Runner
testCount
-
Constructor Details
-
SerenityRunner
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
SerenityRunner
public SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory) throws org.junit.runners.model.InitializationError Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
SerenityRunner
public SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory, net.thucydides.core.webdriver.DriverConfiguration configuration) throws org.junit.runners.model.InitializationError Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
SerenityRunner
public SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebDriverFactory webDriverFactory, net.thucydides.core.webdriver.DriverConfiguration configuration, net.thucydides.model.batches.BatchManager batchManager) throws org.junit.runners.model.InitializationError Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
SerenityRunner
public SerenityRunner(Class<?> klass, net.thucydides.model.batches.BatchManager batchManager) throws org.junit.runners.model.InitializationError Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
SerenityRunner
public SerenityRunner(Class<?> klass, net.thucydides.core.webdriver.WebdriverManager webDriverManager, net.thucydides.core.webdriver.DriverConfiguration configuration, net.thucydides.model.batches.BatchManager batchManager) throws org.junit.runners.model.InitializationError Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
org.junit.runners.model.InitializationError
-
-
Method Details
-
getPages
public net.thucydides.core.pages.Pages getPages()Deprecated, for removal: This API element is subject to removal in a future version. -
getConfiguration
protected net.thucydides.core.webdriver.DriverConfiguration getConfiguration()Deprecated, for removal: This API element is subject to removal in a future version.The Configuration class manages output directories and driver types. They can be defined as system values, or have sensible defaults.- Returns:
- the current configuration
-
getBatchManager
protected net.thucydides.model.batches.BatchManager getBatchManager()Deprecated, for removal: This API element is subject to removal in a future version.Batch Manager used for running tests in parallel batches- Returns:
- the current batch manager object
-
getOutputDirectory
Deprecated, for removal: This API element is subject to removal in a future version. -
subscribeReporter
public void subscribeReporter(net.thucydides.model.reports.AcceptanceTestReporter reporter) Deprecated, for removal: This API element is subject to removal in a future version.To generate reports, different AcceptanceTestReporter instances need to subscribe to the listener. The listener will tell them when the test is done, and the reporter can decide what to do.- Parameters:
reporter- an implementation of the AcceptanceTestReporter interface.
-
useQualifier
Deprecated, for removal: This API element is subject to removal in a future version. -
run
public void run(org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.Runs the tests in the acceptance test case.- Overrides:
runin classorg.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
-
generateReports
protected void generateReports()Deprecated, for removal: This API element is subject to removal in a future version. -
getStepListener
Deprecated, for removal: This API element is subject to removal in a future version.The Step Listener observes and records what happens during the execution of the test. Once the test is over, the Step Listener can provide the acceptance test outcome in the form of an TestOutcome object.- Returns:
- the current step listener
-
setStepListener
Deprecated, for removal: This API element is subject to removal in a future version. -
initStepEventBus
protected void initStepEventBus()Deprecated, for removal: This API element is subject to removal in a future version. -
initListenersUsing
Deprecated, for removal: This API element is subject to removal in a future version. -
initListeners
Deprecated, for removal: This API element is subject to removal in a future version. -
runChild
protected void runChild(org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
runChildin classorg.junit.runners.BlockJUnit4ClassRunner
-
additionalBrowserCleanup
protected void additionalBrowserCleanup()Deprecated, for removal: This API element is subject to removal in a future version. -
prepareBrowserForTest
protected void prepareBrowserForTest()Deprecated, for removal: This API element is subject to removal in a future version. -
methodInvoker
protected org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method, Object test) Deprecated, for removal: This API element is subject to removal in a future version.Running a unit test, which represents a test scenario.- Overrides:
methodInvokerin classorg.junit.runners.BlockJUnit4ClassRunner
-
injectDriverInto
Deprecated, for removal: This API element is subject to removal in a future version.Instantiate the @Managed-annotated WebDriver instance with current WebDriver.- Parameters:
testCase- A Serenity-annotated test class
-
driverFor
protected org.openqa.selenium.WebDriver driverFor(org.junit.runners.model.FrameworkMethod method) Deprecated, for removal: This API element is subject to removal in a future version. -
injectScenarioStepsInto
Deprecated, for removal: This API element is subject to removal in a future version.Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.- Parameters:
testCase- A Serenity-annotated test class
-
injectAnnotatedPagesObjectInto
Deprecated, for removal: This API element is subject to removal in a future version.Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.- Parameters:
testCase- A Serenity-annotated test class
-
injectEnvironmentVariablesInto
Deprecated, for removal: This API element is subject to removal in a future version. -
getDriver
protected org.openqa.selenium.WebDriver getDriver()Deprecated, for removal: This API element is subject to removal in a future version. -
getDriver
Deprecated, for removal: This API element is subject to removal in a future version. -
getTestOutcomes
Deprecated, for removal: This API element is subject to removal in a future version.Find the current set of test outcomes produced by the test execution.- Returns:
- the current list of test outcomes
-
getDefaultReporters
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The default reporters applicable for standard test runs.
-