Package io.fluentlenium.adapter.testng
Class FluentTestNgSpringTest
java.lang.Object
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
io.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 io.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
Field Summary
Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
applicationContext, logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Invoked when a test method has failed (before finished)protected void
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 testGet the test adapter configuration.Get the control interface containerfinal org.openqa.selenium.WebDriver
returns WebDriver instanceGet Fluent Control<T extends Annotation>
TgetMethodAnnotation
(Class<T> annotation) Allows to access method level annotation of currently running testClass<?>
protected void
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 io.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 io.fluentlenium.adapter.IFluentAdapter
initFluent, initFluent, isFluentControlAvailable, newWebDriver, releaseFluent, setFluentControl
-
Constructor Details
-
FluentTestNgSpringTest
public FluentTestNgSpringTest()
-
-
Method Details
-
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
- Specified by:
getTestClass
in interfaceTestRunnerAdapter
- Returns:
- Class of currently running test
-
getTestMethodName
- Specified by:
getTestMethodName
in interfaceTestRunnerAdapter
- Returns:
- method name (as String) of currently running test
-
getClassAnnotation
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
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
Invoked when a test method is starting.- Parameters:
testClass
- Test classtestName
- Test name
-
finished
Invoked when a test method has finished (whatever the success of failing status)- Parameters:
testClass
- Test classtestName
- Test name
-
failed
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
Description copied from interface:FluentControl
Get Fluent Control- Specified by:
getFluentControl
in interfaceFluentControl
- Specified by:
getFluentControl
in interfaceIFluentAdapter
- Returns:
- FluentControl instance
-
getControlContainer
Description copied from interface:FluentControl
Get the control interface container- Specified by:
getControlContainer
in interfaceFluentControl
- Returns:
- control interface container
-
getConfiguration
Description copied from interface:FluentControl
Get the test adapter configuration.- Specified by:
getConfiguration
in interfaceFluentControl
- Returns:
- configuration
-