Package org.fluentlenium.adapter
Class FluentTestRunnerAdapter
- java.lang.Object
-
- org.fluentlenium.core.FluentControlImpl
-
- org.fluentlenium.adapter.FluentAdapter
-
- org.fluentlenium.adapter.FluentTestRunnerAdapter
-
- All Implemented Interfaces:
Configuration
,ConfigurationMutator
,ConfigurationProperties
,InputControl
,AlertControl
,CapabilitiesControl
,ComponentInstantiator
,CssControl
,EventsControl
,FluentControl
,FluentInjectControl
,NavigationControl
,PerformanceTimingControl
,JavascriptControl
,SearchControl<FluentWebElement>
,SeleniumDriverControl
,SnapshotControl
,AwaitControl
public class FluentTestRunnerAdapter extends FluentAdapter
FluentLenium Test Runner Adapter.Extends this class to provide FluentLenium support to your Test class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
-
Constructor Summary
Constructors Constructor Description FluentTestRunnerAdapter()
Creates a new test runner adapter.FluentTestRunnerAdapter(FluentControlContainer driverContainer)
Creates a test runner adapter, with a custom driver container.FluentTestRunnerAdapter(FluentControlContainer driverContainer, java.lang.Class clazz, SharedMutator sharedMutator)
Creates a test runner adapter, with a customer driver container and a customer shared mutator.FluentTestRunnerAdapter(FluentControlContainer driverContainer, SharedMutator sharedMutator)
Creates a test runner adapter, with a customer driver container and a customer shared mutator.FluentTestRunnerAdapter(SharedMutator sharedMutator)
Creates a test runner adapter, with a custom shared mutator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
afterClass(java.lang.Class<?> testClass)
Invoked when a test class has finished (whatever the success of failing status)protected void
failed()
Invoked when a test method has failed (before finished)protected void
failed(java.lang.Class<?> testClass)
Invoked when a test method has failed (before finished)protected void
failed(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has failed (before finished)protected void
failed(java.lang.String testName)
Invoked when a test method has failed (before finished)protected void
failed(java.lang.Throwable e, java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has failed (before finished)protected void
finished()
Invoked when a test method has finished (whatever the success of failing status)protected void
finished(java.lang.Class<?> testClass)
Invoked when a test method has finished (whatever the success of failing status)protected void
finished(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has finished (whatever the success of failing status)protected void
finished(java.lang.String testName)
Invoked when a test method has finished (whatever the success of failing status)protected <T extends java.lang.annotation.Annotation>
TgetClassAnnotation(java.lang.Class<T> annotation)
Allows to access Class level annotation of currently running testprotected <T extends java.lang.annotation.Annotation>
TgetMethodAnnotation(java.lang.Class<T> annotation)
Allows to access method level annotation of currently running testprotected SharedWebDriver
getSharedWebDriver(SharedMutator.EffectiveParameters<?> parameters, java.util.concurrent.ExecutorService webDriverExecutor)
Returns SharedDriver instanceprotected java.lang.Class<?>
getTestClass()
protected java.lang.String
getTestMethodName()
protected void
starting()
Invoked when a test method is starting.protected void
starting(java.lang.Class<?> testClass)
Invoked when a test method is starting.protected void
starting(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method is starting.protected void
starting(java.lang.String testName)
Invoked when a test method is starting.-
Methods inherited from class org.fluentlenium.adapter.FluentAdapter
getDriver, getFluentControl, initFluent, newWebDriver, releaseFluent
-
Methods inherited from class org.fluentlenium.core.FluentControlImpl
alert, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, await, canTakeScreenShot, capabilities, css, el, events, executeAsyncScript, executeScript, find, find, find, find, getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, getConfiguration, getConfigurationDefaults, getConfigurationFactory, getControlContainer, getCookie, getCookies, getCustomProperty, getDeleteCookies, getDriverLifecycle, getEventsEnabled, getHtmlDumpMode, getHtmlDumpPath, getImplicitlyWait, getPageLoadTimeout, getRemoteUrl, getScreenshotMode, getScreenshotPath, getScriptTimeout, getWebDriver, goTo, goTo, goToInNewTab, inject, injectComponent, isComponentClass, isComponentListClass, keyboard, mouse, newComponent, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newInstance, pageSource, performanceTiming, setAwaitAtMost, setAwaitPollingEvery, setBaseUrl, setBrowserTimeout, setBrowserTimeoutRetries, setCapabilities, setConfigurationFactory, setCustomProperty, setDeleteCookies, setDriverLifecycle, setEventsEnabled, setHtmlDumpMode, setHtmlDumpPath, setImplicitlyWait, setPageLoadTimeout, setRemoteUrl, setScreenshotMode, setScreenshotPath, setScriptTimeout, setWebDriver, switchTo, switchTo, switchTo, switchToDefault, takeHtmlDump, takeHtmlDump, takeScreenshot, takeScreenshot, url, window
-
-
-
-
Constructor Detail
-
FluentTestRunnerAdapter
public FluentTestRunnerAdapter()
Creates a new test runner adapter.
-
FluentTestRunnerAdapter
public FluentTestRunnerAdapter(FluentControlContainer driverContainer)
Creates a test runner adapter, with a custom driver container.- Parameters:
driverContainer
- driver container
-
FluentTestRunnerAdapter
public FluentTestRunnerAdapter(SharedMutator sharedMutator)
Creates a test runner adapter, with a custom shared mutator.- Parameters:
sharedMutator
- shared mutator.
-
FluentTestRunnerAdapter
public FluentTestRunnerAdapter(FluentControlContainer driverContainer, SharedMutator sharedMutator)
Creates a test runner adapter, with a customer driver container and a customer shared mutator.- Parameters:
driverContainer
- driver containersharedMutator
- shared mutator
-
FluentTestRunnerAdapter
public FluentTestRunnerAdapter(FluentControlContainer driverContainer, java.lang.Class clazz, SharedMutator sharedMutator)
Creates a test runner adapter, with a customer driver container and a customer shared mutator. It is possible to pass class from which the FluentConfiguration annotation will be loaded.- Parameters:
driverContainer
- driver containerclazz
- class from which FluentConfiguration annotation will be loadedsharedMutator
- shared mutator
-
-
Method Detail
-
afterClass
public static void afterClass(java.lang.Class<?> testClass)
Invoked when a test class has finished (whatever the success of failing status)- Parameters:
testClass
- test class to terminate
-
getTestClass
protected java.lang.Class<?> getTestClass()
- Returns:
- Class of currently running test
-
getTestMethodName
protected java.lang.String getTestMethodName()
- Returns:
- method name (as String) of currently running test
-
getClassAnnotation
protected <T extends java.lang.annotation.Annotation> T getClassAnnotation(java.lang.Class<T> annotation)
Allows to access Class level annotation of currently running test- Type Parameters:
T
- the class annotation- Parameters:
annotation
- interface you want to access- Returns:
- Annotation instance
- Throws:
AnnotationNotFoundException
- when annotation you want to access couldn't be find
-
getMethodAnnotation
protected <T extends java.lang.annotation.Annotation> T getMethodAnnotation(java.lang.Class<T> annotation)
Allows to access method level annotation of currently running test- Type Parameters:
T
- the method annotation- Parameters:
annotation
- interface you want to access- Returns:
- Annotation instance
- Throws:
AnnotationNotFoundException
- of annotation you want to access couldn't be foundMethodNotFoundException
- if test method couldn't be found - if it occurs that's most likely FL bug
-
starting
protected void starting()
Invoked when a test method is starting.
-
starting
protected void starting(java.lang.String testName)
Invoked when a test method is starting.- Parameters:
testName
- Test name
-
starting
protected void starting(java.lang.Class<?> testClass)
Invoked when a test method is starting.- Parameters:
testClass
- Test class
-
starting
protected void starting(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method is starting.- Parameters:
testClass
- Test classtestName
- Test name
-
getSharedWebDriver
protected SharedWebDriver getSharedWebDriver(SharedMutator.EffectiveParameters<?> parameters, java.util.concurrent.ExecutorService webDriverExecutor) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Returns SharedDriver instance- Parameters:
parameters
- driver parameterswebDriverExecutor
- executor service- Returns:
- SharedDriver
- Throws:
java.util.concurrent.ExecutionException
- execution exceptionjava.lang.InterruptedException
- interrupted exception
-
finished
protected void finished()
Invoked when a test method has finished (whatever the success of failing status)
-
finished
protected void finished(java.lang.String testName)
Invoked when a test method has finished (whatever the success of failing status)- Parameters:
testName
- Test name
-
finished
protected void finished(java.lang.Class<?> testClass)
Invoked when a test method has finished (whatever the success of failing status)- Parameters:
testClass
- Test class
-
finished
protected void finished(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has finished (whatever the success of failing status)- Parameters:
testClass
- Test classtestName
- Test name
-
failed
protected void failed()
Invoked when a test method has failed (before finished)
-
failed
protected void failed(java.lang.String testName)
Invoked when a test method has failed (before finished)- Parameters:
testName
- Test name
-
failed
protected void failed(java.lang.Class<?> testClass)
Invoked when a test method has failed (before finished)- Parameters:
testClass
- Test class
-
failed
protected void failed(java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has failed (before finished)- Parameters:
testClass
- Test classtestName
- Test name
-
failed
protected void failed(java.lang.Throwable e, java.lang.Class<?> testClass, java.lang.String testName)
Invoked when a test method has failed (before finished)- Parameters:
e
- Throwable thrown by the failing test.testClass
- Test classtestName
- Test name
-
-