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.

  • 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 method
      context - 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 interface TestRunnerAdapter
      Returns:
      Class of currently running test
    • getTestMethodName

      public String getTestMethodName()
      Specified by:
      getTestMethodName in interface TestRunnerAdapter
      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 interface TestRunnerAdapter
      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 interface TestRunnerAdapter
      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 class
      testName - 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 class
      testName - 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 class
      testName - Test name
    • getDriver

      public final org.openqa.selenium.WebDriver getDriver()
      Description copied from interface: IFluentAdapter
      returns WebDriver instance
      Specified by:
      getDriver in interface FluentControl
      Specified by:
      getDriver in interface IFluentAdapter
      Specified by:
      getDriver in interface SeleniumDriverControl
      Returns:
      current webdriver
    • getFluentControl

      public ContainerFluentControl getFluentControl()
      Description copied from interface: FluentControl
      Get Fluent Control
      Specified by:
      getFluentControl in interface FluentControl
      Specified by:
      getFluentControl in interface IFluentAdapter
      Returns:
      FluentControl instance
    • getControlContainer

      public FluentControlContainer getControlContainer()
      Description copied from interface: FluentControl
      Get the control interface container
      Specified by:
      getControlContainer in interface FluentControl
      Returns:
      control interface container
    • getConfiguration

      public Configuration getConfiguration()
      Description copied from interface: FluentControl
      Get the test adapter configuration.
      Specified by:
      getConfiguration in interface FluentControl
      Returns:
      configuration