Package io.fluentlenium.core.events
Class EventsRegistry
java.lang.Object
io.fluentlenium.core.events.EventsRegistry
- All Implemented Interfaces:
org.openqa.selenium.WrapsDriver
Registry of event listeners.
-
Field Summary
Modifier and TypeFieldDescriptionfinal List<AlertListener>
final List<AlertListener>
final List<ElementListener>
final List<ElementListener>
final List<FindByListener>
final List<GetScreenshotAsListener>
final List<ElementListener>
final List<NavigateAllListener>
final List<NavigateListener>
final List<NavigateListener>
final List<NavigateListener>
final List<NavigateToListener>
final List<ScriptListener>
final List<SwitchToWindowListener>
final List<AlertListener>
final List<AlertListener>
final List<ElementListener>
final List<ElementListener>
final List<FindByListener>
final List<GetScreenshotAsListener>
final List<ElementListener>
final List<NavigateAllListener>
final List<NavigateListener>
final List<NavigateListener>
final List<NavigateListener>
final List<NavigateToListener>
final List<ScriptListener>
final List<SwitchToWindowListener>
final List<ExceptionListener>
-
Constructor Summary
ConstructorDescriptionEventsRegistry
(FluentControl control) Creates a new registry of event listeners. -
Method Summary
Modifier and TypeMethodDescriptionafterAlertAccept
(AlertListener listener) Add a listener that will be invoked after an alert is accepted.afterAlertDismiss
(AlertListener listener) Add a listener that will be invoked after an alert is dismissed.afterChangeValueOf
(ElementListener listener) Add a listener that will be invoked after changing value of an element.afterClickOn
(ElementListener listener) Add a listener that will be invoked after clicking an element.afterFindBy
(FindByListener listener) Add a listener that will be invoked after finding an element.afterGetScreenshotAs
(GetScreenshotAsListener listener) Add a listener that will be invoked after getScreenshotAs.afterGetText
(ElementListener listener) Add a listener that will be invoked after get text of an element.afterNavigate
(NavigateAllListener listener) Add a listener that will be invoked after navigating.afterNavigateBack
(NavigateListener listener) Add a listener that will be invoked after navigating back.afterNavigateForward
(NavigateListener listener) Add a listener that will be invoked after navigating forward.afterNavigateRefresh
(NavigateListener listener) Add a listener that will be invoked after refresh.afterNavigateTo
(NavigateToListener listener) Add a listener that will be invoked after navigation.afterScript
(ScriptListener listener) Add a listener that will be invoked after executing a script.afterSwitchToWindow
(SwitchToWindowListener listener) Add a listener that will be invoked after window switch.beforeAlertAccept
(AlertListener listener) Add a listener that will be invoked before an alert is accepted.beforeAlertDismiss
(AlertListener listener) Add a listener that will be invoked before an alert is dismissed.beforeChangeValueOf
(ElementListener listener) Add a listener that will be invoked before changing value of an element.beforeClickOn
(ElementListener listener) Add a listener that will be invoked before clicking an element.beforeFindBy
(FindByListener listener) Add a listener that will be invoked before finding an element.beforeGetScreenshotAs
(GetScreenshotAsListener listener) Add a listener that will be invoked before getScreenshotAs.beforeGetText
(ElementListener listener) Add a listener that will be invoked before get text of an element.beforeNavigate
(NavigateAllListener listener) Add a listener that will be invoked before navigating.beforeNavigateBack
(NavigateListener listener) Add a listener that will be invoked before navigating back.beforeNavigateForward
(NavigateListener listener) Add a listener that will be invoked before navigating forward.beforeNavigateRefresh
(NavigateListener listener) Add a listener that will be invoked before refresh.beforeNavigateTo
(NavigateToListener listener) Add a listener that will be invoked before navigating to an url.beforeScript
(ScriptListener listener) Add a listener that will be invoked before executing a script.beforeSwitchToWindow
(SwitchToWindowListener listener) Add a listener that will be invoked before window switch.void
close()
Unregister all event listeners.org.openqa.selenium.WebDriver
onException
(ExceptionListener listener) Add a listener that will be invoked after an exception occurred.register
(EventListener eventListener) Register a new event listener.register
(org.openqa.selenium.support.events.WebDriverEventListener eventListener) Register a new event listener.protected void
Sort listeners based on priority.unregister
(EventListener eventListener) Unregister an existing event listener.void
unregisterContainer
(Object container) Unregister all listeners attached to a given container.
-
Field Details
-
beforeFindBy
-
afterFindBy
-
beforeClickOn
-
afterClickOn
-
beforeGetText
-
afterGetText
-
beforeChangeValueOf
-
afterChangeValueOf
-
beforeScript
-
afterScript
-
beforeAlertAccept
-
afterAlertAccept
-
beforeAlertDismiss
-
afterAlertDismiss
-
beforeSwitchToWindow
-
afterSwitchToWindow
-
beforeGetScreenshotAs
-
afterGetScreenshotAs
-
onException
-
eventLists
-
Constructor Details
-
EventsRegistry
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
Register a new event listener.- Parameters:
eventListener
- event listener to register- Returns:
this
to chain method calls
-
unregister
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 interfaceorg.openqa.selenium.WrapsDriver
-
beforeFindBy
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Add a listener that will be invoked after window switch.- Parameters:
listener
- listener invoked after window switch.- Returns:
this
to chain method calls
-
beforeSwitchToWindow
Add a listener that will be invoked before window switch.- Parameters:
listener
- listener invoked before window switch.- Returns:
this
to chain method calls
-
afterGetScreenshotAs
Add a listener that will be invoked after getScreenshotAs.- Parameters:
listener
- listener invoked after getScreenshotAs.- Returns:
this
to chain method calls
-
beforeGetScreenshotAs
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
Unregister all listeners attached to a given container.- Parameters:
container
- container
-