Package org.fluentlenium.adapter.testng
Class FluentTestNgSpringTest
- java.lang.Object
-
- org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
- org.fluentlenium.adapter.testng.FluentTestNgSpringTest
-
- All Implemented Interfaces:
IFluentAdapter
,TestRunnerAdapter
,Configuration
,ConfigurationMutator
,ConfigurationProperties
,InputControl
,AlertControl
,CapabilitiesControl
,ComponentInstantiator
,CssControl
,EventsControl
,FluentControl
,FluentInjectControl
,NavigationControl
,PerformanceTimingControl
,JavascriptControl
,SearchControl<FluentWebElement>
,SeleniumDriverControl
,SnapshotControl
,AwaitControl
,ChromiumControl
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.testng.IHookable
,org.testng.ITestNGListener
public class FluentTestNgSpringTest extends org.springframework.test.context.testng.AbstractTestNGSpringContextTests
TestNG FluentLenium Test Runner Adapter.Extends this class to provide FluentLenium support to your TestNG Test class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
-
Constructor Summary
Constructors Constructor Description FluentTestNgSpringTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterClass()
After test class.void
afterMethod(org.testng.ITestResult result)
After test method.void
afterTest(org.testng.ITestContext context)
After test.void
beforeMethod(Method method, org.testng.ITestContext context)
Before test.protected void
failed(Throwable e, Class<?> testClass, String testName)
Invoked when a test method has failed (before finished)protected void
finished(Class<?> testClass, String testName)
Invoked when a test method has finished (whatever the success of failing status)<T extends Annotation>
TgetClassAnnotation(Class<T> annotation)
Allows to access Class level annotation of currently running testConfiguration
getConfiguration()
Get the test adapter configuration.FluentControlContainer
getControlContainer()
Get the control interface containerorg.openqa.selenium.WebDriver
getDriver()
returns WebDriver instanceContainerFluentControl
getFluentControl()
Get Fluent Control<T extends Annotation>
TgetMethodAnnotation(Class<T> annotation)
Allows to access method level annotation of currently running testClass<?>
getTestClass()
String
getTestMethodName()
protected void
starting(Class<?> testClass, String testName)
Invoked when a test method is starting.-
Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.fluentlenium.core.FluentControl
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, getAppiumDriver, getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, getChromiumApi, 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
-
Methods inherited from interface org.fluentlenium.adapter.IFluentAdapter
initFluent, initFluent, isFluentControlAvailable, newWebDriver, releaseFluent, setFluentControl
-
-
-
-
Method Detail
-
afterTest
@AfterTest(alwaysRun=true) public void afterTest(org.testng.ITestContext context)
After test.- Parameters:
context
- test context
-
beforeMethod
@BeforeMethod(alwaysRun=true) public void beforeMethod(Method method, org.testng.ITestContext context)
Before test.- Parameters:
method
- test methodcontext
- test context
-
afterMethod
@AfterMethod(alwaysRun=true) public void afterMethod(org.testng.ITestResult result)
After test method.- Parameters:
result
- test result
-
afterClass
@AfterClass(alwaysRun=true) public void afterClass()
After test class.
-
getTestClass
public Class<?> getTestClass()
- Specified by:
getTestClass
in interfaceTestRunnerAdapter
- Returns:
- Class of currently running test
-
getTestMethodName
public String getTestMethodName()
- Specified by:
getTestMethodName
in interfaceTestRunnerAdapter
- Returns:
- method name (as String) of currently running test
-
getClassAnnotation
public <T extends Annotation> T getClassAnnotation(Class<T> annotation)
Description copied from interface:TestRunnerAdapter
Allows to access Class level annotation of currently running test- Specified by:
getClassAnnotation
in interfaceTestRunnerAdapter
- Type Parameters:
T
- the class annotation- Parameters:
annotation
- interface you want to access- Returns:
- Annotation instance
-
getMethodAnnotation
public <T extends Annotation> T getMethodAnnotation(Class<T> annotation)
Description copied from interface:TestRunnerAdapter
Allows to access method level annotation of currently running test- Specified by:
getMethodAnnotation
in interfaceTestRunnerAdapter
- Type Parameters:
T
- the method annotation- Parameters:
annotation
- interface you want to access- Returns:
- Annotation instance
-
starting
protected void starting(Class<?> testClass, String testName)
Invoked when a test method is starting.- Parameters:
testClass
- Test classtestName
- Test name
-
finished
protected void finished(Class<?> testClass, 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(Throwable e, Class<?> testClass, String testName)
Invoked when a test method has failed (before finished)- Parameters:
e
- Throwable thrown by the failing test.testClass
- Test classtestName
- Test name
-
getDriver
public final org.openqa.selenium.WebDriver getDriver()
Description copied from interface:IFluentAdapter
returns WebDriver instance- Specified by:
getDriver
in interfaceFluentControl
- Specified by:
getDriver
in interfaceIFluentAdapter
- Specified by:
getDriver
in interfaceSeleniumDriverControl
- Returns:
- current webdriver
-
getFluentControl
public ContainerFluentControl getFluentControl()
Description copied from interface:FluentControl
Get Fluent Control- Specified by:
getFluentControl
in interfaceFluentControl
- Specified by:
getFluentControl
in interfaceIFluentAdapter
- Returns:
- FluentControl instance
-
getControlContainer
public FluentControlContainer getControlContainer()
Description copied from interface:FluentControl
Get the control interface container- Specified by:
getControlContainer
in interfaceFluentControl
- Returns:
- control interface container
-
getConfiguration
public Configuration getConfiguration()
Description copied from interface:FluentControl
Get the test adapter configuration.- Specified by:
getConfiguration
in interfaceFluentControl
- Returns:
- configuration
-
-