public class Serenity extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Serenity.SerenityConfigurer |
static class |
Serenity.SessionVariableSetter |
Constructor and Description |
---|
Serenity() |
Modifier and Type | Method and Description |
---|---|
static void |
clearCurrentSession() |
static void |
clearSessionVariable(String key) |
static boolean |
currentDriverIsDisabled() |
static void |
done()
Indicate that the test run using this object is finished, and reports can be generated.
|
static void |
done(boolean closeAllDrivers) |
static SessionMap<Object,Object> |
getCurrentSession() |
static String |
getCurrentSessionID() |
static String |
getDefaultProjectKey() |
static org.openqa.selenium.WebDriver |
getDriver() |
static org.openqa.selenium.firefox.FirefoxProfile |
getFirefoxProfile() |
protected static Pages |
getPages() |
static Pages |
getPagesFactory() |
static StepFactory |
getStepFactory() |
static StepListener |
getStepListener() |
static WebdriverManager |
getWebdriverManager() |
static boolean |
hasASessionVariableCalled(Object key) |
static void |
ignoredStep(String reason) |
static void |
initialize(Object testCase)
Initialize Serenity-related fields in the specified object.
|
static void |
initializeTestSession() |
static Serenity.SerenityConfigurer |
initializeWithNoStepListener(Object testCase)
Initialize Serenity-related fields in the specified object.
|
static void |
initStepListener() |
static void |
injectAnnotatedPagesObjectInto(Object testCase)
Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.
|
static void |
injectDependenciesInto(Object testCase) |
static void |
injectDriverInto(Object testCase)
Instantiate the @Managed-annotated WebDriver instance with current WebDriver.
|
static void |
injectScenarioStepsInto(Object testCase)
Instantiates the @ManagedPages-annotated Pages instance using current WebDriver.
|
static void |
pendingStep(String reason) |
static WithTitle |
recordReportData() |
static void |
reportThat(String message,
Reportable reportableAction)
Perform an arbitrary task and record it as a step in the reports.
|
static <T> T |
sessionVariableCalled(Object key) |
static Serenity.SessionVariableSetter |
setSessionVariable(Object key) |
static boolean |
shouldThrowErrorsImmediately() |
protected static void |
stopUsingMockDriver() |
static void |
takeScreenshot() |
static void |
throwExceptionsImmediately() |
static void |
useFirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile profile) |
static WebDriverConfigurer |
webdriver() |
public static void initialize(Object testCase)
testCase
- any object (testcase or other) containing injectable Serenity componentspublic static void injectDependenciesInto(Object testCase)
public static Serenity.SerenityConfigurer initializeWithNoStepListener(Object testCase)
testCase
- any object (testcase or other) containing injectable Serenity componentspublic static void initStepListener()
public static void injectDriverInto(Object testCase)
testCase
- any object (testcase or other) containing injectable Serenity componentspublic static void injectScenarioStepsInto(Object testCase)
testCase
- any object (testcase or other) containing injectable Serenity componentspublic static void injectAnnotatedPagesObjectInto(Object testCase)
testCase
- any object (testcase or other) containing injectable Serenity componentspublic static void done()
public static boolean currentDriverIsDisabled()
public static void done(boolean closeAllDrivers)
public static String getCurrentSessionID()
public static org.openqa.selenium.WebDriver getDriver()
protected static Pages getPages()
protected static void stopUsingMockDriver()
public static WebdriverManager getWebdriverManager()
public static StepFactory getStepFactory()
public static StepListener getStepListener()
public static void initializeTestSession()
public static SessionMap<Object,Object> getCurrentSession()
public static void pendingStep(String reason)
public static void ignoredStep(String reason)
public static void takeScreenshot()
public static WithTitle recordReportData()
public static String getDefaultProjectKey()
public static void useFirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile profile)
public static org.openqa.selenium.firefox.FirefoxProfile getFirefoxProfile()
public static boolean hasASessionVariableCalled(Object key)
public static <T> T sessionVariableCalled(Object key)
public static Serenity.SessionVariableSetter setSessionVariable(Object key)
public static void clearSessionVariable(String key)
public static void clearCurrentSession()
public static Pages getPagesFactory()
public static void throwExceptionsImmediately()
public static boolean shouldThrowErrorsImmediately()
public static WebDriverConfigurer webdriver()
public static void reportThat(String message, Reportable reportableAction)
message
- reportableAction
- Copyright © 2021. All rights reserved.