Class EventsRegistry

java.lang.Object
io.fluentlenium.core.events.EventsRegistry
All Implemented Interfaces:
org.openqa.selenium.WrapsDriver

public class EventsRegistry extends Object implements org.openqa.selenium.WrapsDriver
Registry of event listeners.
  • Field Details

  • Constructor Details

    • EventsRegistry

      public EventsRegistry (FluentControl control)
      Creates a new registry of event listeners.
      Parameters:
      control - control interface
  • Method Details

    • register

      public EventsRegistry register (org.openqa.selenium.support.events.WebDriverEventListener eventListener)
      Register a new event listener.
      Parameters:
      eventListener - event listener to register
      Returns:
      this to chain method calls
    • register

      public EventsRegistry register (EventListener eventListener)
      Register a new event listener.
      Parameters:
      eventListener - event listener to register
      Returns:
      this to chain method calls
    • unregister

      public EventsRegistry unregister (EventListener eventListener)
      Unregister an existing event listener.
      Parameters:
      eventListener - existing event listener to unregister
      Returns:
      this to chain method calls
    • close

      public void close()
      Unregister all event listeners.
    • getWrappedDriver

      public org.openqa.selenium.WebDriver getWrappedDriver()
      Specified by:
      getWrappedDriver in interface org.openqa.selenium.WrapsDriver
    • beforeNavigateTo

      public EventsRegistry beforeNavigateTo (NavigateToListener listener)
      Add a listener that will be invoked before navigating to an url.
      Parameters:
      listener - listener invoked before navigating to an url.
      Returns:
      this to chain method calls
    • afterNavigateTo

      public EventsRegistry afterNavigateTo (NavigateToListener listener)
      Add a listener that will be invoked after navigation.
      Parameters:
      listener - listener invoked after navigation.
      Returns:
      this to chain method calls
    • beforeNavigateBack

      public EventsRegistry beforeNavigateBack (NavigateListener listener)
      Add a listener that will be invoked before navigating back.
      Parameters:
      listener - listener invoked before navigating back.
      Returns:
      this to chain method calls
    • afterNavigateBack

      public EventsRegistry afterNavigateBack (NavigateListener listener)
      Add a listener that will be invoked after navigating back.
      Parameters:
      listener - listener invoked after navigating back.
      Returns:
      this to chain method calls
    • beforeNavigateForward

      public EventsRegistry beforeNavigateForward (NavigateListener listener)
      Add a listener that will be invoked before navigating forward.
      Parameters:
      listener - listener invoked before navigating forward.
      Returns:
      this to chain method calls
    • afterNavigateForward

      public EventsRegistry afterNavigateForward (NavigateListener listener)
      Add a listener that will be invoked after navigating forward.
      Parameters:
      listener - listener invoked after navigating forward.
      Returns:
      this to chain method calls
    • beforeNavigate

      public EventsRegistry beforeNavigate (NavigateAllListener listener)
      Add a listener that will be invoked before navigating.
      Parameters:
      listener - listener invoked before navigating.
      Returns:
      this to chain method calls
    • afterNavigate

      public EventsRegistry afterNavigate (NavigateAllListener listener)
      Add a listener that will be invoked after navigating.
      Parameters:
      listener - listener invoked after navigating.
      Returns:
      this to chain method calls
    • beforeNavigateRefresh

      public EventsRegistry beforeNavigateRefresh (NavigateListener listener)
      Add a listener that will be invoked before refresh.
      Parameters:
      listener - listener invoked before refresh.
      Returns:
      this to chain method calls
    • afterNavigateRefresh

      public EventsRegistry afterNavigateRefresh (NavigateListener listener)
      Add a listener that will be invoked after refresh.
      Parameters:
      listener - listener invoked after refresh.
      Returns:
      this to chain method calls
    • beforeFindBy

      public EventsRegistry beforeFindBy (FindByListener listener)
      Add a listener that will be invoked before finding an element.
      Parameters:
      listener - listener invoked before finding an element.
      Returns:
      this to chain method calls
    • afterFindBy

      public EventsRegistry afterFindBy (FindByListener listener)
      Add a listener that will be invoked after finding an element.
      Parameters:
      listener - listener invoked after finding an element.
      Returns:
      this to chain method calls
    • beforeClickOn

      public EventsRegistry beforeClickOn (ElementListener listener)
      Add a listener that will be invoked before clicking an element.
      Parameters:
      listener - listener invoked before clicking an element.
      Returns:
      this to chain method calls
    • afterClickOn

      public EventsRegistry afterClickOn (ElementListener listener)
      Add a listener that will be invoked after clicking an element.
      Parameters:
      listener - listener invoked after clicking an element.
      Returns:
      this to chain method calls
    • beforeGetText

      public EventsRegistry beforeGetText (ElementListener listener)
      Add a listener that will be invoked before get text of an element.
      Parameters:
      listener - listener invoked before get text of an element.
      Returns:
      this to chain method calls
    • afterGetText

      public EventsRegistry afterGetText (ElementListener listener)
      Add a listener that will be invoked after get text of an element.
      Parameters:
      listener - listener invoked after get text of an element.
      Returns:
      this to chain method calls
    • beforeChangeValueOf

      public EventsRegistry beforeChangeValueOf (ElementListener listener)
      Add a listener that will be invoked before changing value of an element.
      Parameters:
      listener - listener invoked before changing value of an element.
      Returns:
      this to chain method calls
    • afterChangeValueOf

      public EventsRegistry afterChangeValueOf (ElementListener listener)
      Add a listener that will be invoked after changing value of an element.
      Parameters:
      listener - listener invoked after changing value of an element.
      Returns:
      this to chain method calls
    • beforeScript

      public EventsRegistry beforeScript (ScriptListener listener)
      Add a listener that will be invoked before executing a script.
      Parameters:
      listener - listener invoked before executing a script.
      Returns:
      this to chain method calls
    • afterScript

      public EventsRegistry afterScript (ScriptListener listener)
      Add a listener that will be invoked after executing a script.
      Parameters:
      listener - listener invoked after executing a script.
      Returns:
      this to chain method calls
    • beforeAlertAccept

      public EventsRegistry beforeAlertAccept (AlertListener listener)
      Add a listener that will be invoked before an alert is accepted.
      Parameters:
      listener - listener invoked before an alert is accepted.
      Returns:
      this to chain method calls
    • afterAlertAccept

      public EventsRegistry afterAlertAccept (AlertListener listener)
      Add a listener that will be invoked after an alert is accepted.
      Parameters:
      listener - listener invoked after an alert is accepted.
      Returns:
      this to chain method calls
    • beforeAlertDismiss

      public EventsRegistry beforeAlertDismiss (AlertListener listener)
      Add a listener that will be invoked before an alert is dismissed.
      Parameters:
      listener - listener invoked before an alert is dismissed.
      Returns:
      this to chain method calls
    • afterAlertDismiss

      public EventsRegistry afterAlertDismiss (AlertListener listener)
      Add a listener that will be invoked after an alert is dismissed.
      Parameters:
      listener - listener invoked after an alert is dismissed.
      Returns:
      this to chain method calls
    • onException

      public EventsRegistry onException (ExceptionListener listener)
      Add a listener that will be invoked after an exception occurred.
      Parameters:
      listener - listener invoked after an exception occurred.
      Returns:
      this to chain method calls
    • afterSwitchToWindow

      public EventsRegistry afterSwitchToWindow (SwitchToWindowListener listener)
      Add a listener that will be invoked after window switch.
      Parameters:
      listener - listener invoked after window switch.
      Returns:
      this to chain method calls
    • beforeSwitchToWindow

      public EventsRegistry beforeSwitchToWindow (SwitchToWindowListener listener)
      Add a listener that will be invoked before window switch.
      Parameters:
      listener - listener invoked before window switch.
      Returns:
      this to chain method calls
    • afterGetScreenshotAs

      public EventsRegistry afterGetScreenshotAs (GetScreenshotAsListener listener)
      Add a listener that will be invoked after getScreenshotAs.
      Parameters:
      listener - listener invoked after getScreenshotAs.
      Returns:
      this to chain method calls
    • beforeGetScreenshotAs

      public EventsRegistry beforeGetScreenshotAs (GetScreenshotAsListener listener)
      Add a listener that will be invoked before getScreenshotAs.
      Parameters:
      listener - listener invoked before getScreenshotAs.
      Returns:
      this to chain method calls
    • sortListeners

      protected void sortListeners()
      Sort listeners based on priority.
      See Also:
    • unregisterContainer

      public void unregisterContainer (Object container)
      Unregister all listeners attached to a given container.
      Parameters:
      container - container