Package io.fluentlenium.core.hook
Class BaseHook<T>
java.lang.Object
io.fluentlenium.core.FluentControlImpl
io.fluentlenium.core.DefaultFluentContainer
io.fluentlenium.core.hook.BaseHook<T>
- Type Parameters:
T
- type of options for the hook
- All Implemented Interfaces:
Configuration
,ConfigurationMutator
,ConfigurationProperties
,InputControl
,AlertControl
,CapabilitiesControl
,ComponentInstantiator
,CssControl
,EventsControl
,FluentContainer
,FluentControl
,FluentHook<T>
,FluentInjectControl
,NavigationControl
,PerformanceTimingControl
,JavascriptControl
,SearchControl<FluentWebElement>
,SeleniumDriverControl
,SnapshotControl
,AwaitControl
,ChromiumControl
,org.openqa.selenium.interactions.Locatable
,org.openqa.selenium.SearchContext
,org.openqa.selenium.support.pagefactory.ElementLocator
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.WebElement
,org.openqa.selenium.WrapsElement
- Direct Known Subclasses:
BaseFluentHook
Base hook implementation.
You should extends this class to implement your own hook.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
Field Summary
Fields inherited from class io.fluentlenium.core.DefaultFluentContainer
control
-
Constructor Summary
ConstructorDescriptionBaseHook
(FluentControl control, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, T options) Creates a new base hook. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
click()
org.openqa.selenium.WebElement
org.openqa.selenium.WebElement
findElement
(org.openqa.selenium.By by) List<org.openqa.selenium.WebElement>
List<org.openqa.selenium.WebElement>
findElements
(org.openqa.selenium.By by) getAttribute
(String name) org.openqa.selenium.interactions.Coordinates
Get coordinates of the underlying element.getCssValue
(String propertyName) final org.openqa.selenium.WebElement
Get the underlying element of the hook.final org.openqa.selenium.support.pagefactory.ElementLocator
Get the underlying element locator of the hook.Get the component instantiator.org.openqa.selenium.Point
Get the options of the hook.org.openqa.selenium.Rectangle
getRect()
<X> X
getScreenshotAs
(org.openqa.selenium.OutputType<X> outputType) org.openqa.selenium.Dimension
getSize()
getText()
org.openqa.selenium.WebElement
boolean
boolean
boolean
protected T
Builds default options.void
sendKeys
(CharSequence... charSequences) void
submit()
toString()
Methods inherited from class io.fluentlenium.core.DefaultFluentContainer
getDriver, getFluentControl, initFluent
Methods inherited from class io.fluentlenium.core.FluentControlImpl
getConfiguration, getControlContainer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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, getConfigurationDefaults, getConfigurationFactory, 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.core.search.SearchControl
$, $, $, $, $, el, el, el, el
Methods inherited from interface org.openqa.selenium.WebElement
getAccessibleName, getAriaRole, getDomAttribute, getDomProperty, getShadowRoot
-
Constructor Details
-
BaseHook
public BaseHook(FluentControl control, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, T options) Creates a new base hook.- Parameters:
control
- control interfaceinstantiator
- component instantiatorelementSupplier
- element supplierlocatorSupplier
- element locator suppliertoStringSupplier
- element toString supplieroptions
- hook options
-
-
Method Details
-
getElement
public final org.openqa.selenium.WebElement getElement()Get the underlying element of the hook.Can be another hook, or a real element.
- Returns:
- underlying element
-
getWrappedElement
public org.openqa.selenium.WebElement getWrappedElement()- Specified by:
getWrappedElement
in interfaceorg.openqa.selenium.WrapsElement
-
getElementLocator
public final org.openqa.selenium.support.pagefactory.ElementLocator getElementLocator()Get the underlying element locator of the hook.- Returns:
- underlying element locator
-
getCoordinates
public org.openqa.selenium.interactions.Coordinates getCoordinates()Get coordinates of the underlying element.- Specified by:
getCoordinates
in interfaceorg.openqa.selenium.interactions.Locatable
- Returns:
- coordinates of underlying element
-
newOptions
Builds default options.- Returns:
- default options
-
getInstantiator
Get the component instantiator.- Returns:
- component instantiator
-
getOptions
Description copied from interface:FluentHook
Get the options of the hook.- Specified by:
getOptions
in interfaceFluentHook<T>
- Returns:
- hook options
-
toString
-
sendKeys
- Specified by:
sendKeys
in interfaceorg.openqa.selenium.WebElement
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException - Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
- Throws:
org.openqa.selenium.WebDriverException
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by) - Specified by:
findElement
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElement
in interfaceorg.openqa.selenium.WebElement
-
isSelected
public boolean isSelected()- Specified by:
isSelected
in interfaceorg.openqa.selenium.WebElement
-
getRect
public org.openqa.selenium.Rectangle getRect()- Specified by:
getRect
in interfaceorg.openqa.selenium.WebElement
-
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayed
in interfaceorg.openqa.selenium.WebElement
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceorg.openqa.selenium.WebElement
-
findElements
- Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElements
in interfaceorg.openqa.selenium.WebElement
-
submit
public void submit()- Specified by:
submit
in interfaceorg.openqa.selenium.WebElement
-
getCssValue
- Specified by:
getCssValue
in interfaceorg.openqa.selenium.WebElement
-
getTagName
- Specified by:
getTagName
in interfaceorg.openqa.selenium.WebElement
-
getLocation
public org.openqa.selenium.Point getLocation()- Specified by:
getLocation
in interfaceorg.openqa.selenium.WebElement
-
getSize
public org.openqa.selenium.Dimension getSize()- Specified by:
getSize
in interfaceorg.openqa.selenium.WebElement
-
getText
- Specified by:
getText
in interfaceorg.openqa.selenium.WebElement
-
click
public void click()- Specified by:
click
in interfaceorg.openqa.selenium.WebElement
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.openqa.selenium.WebElement
-
clear
public void clear()- Specified by:
clear
in interfaceorg.openqa.selenium.WebElement
-
findElement
public org.openqa.selenium.WebElement findElement()- Specified by:
findElement
in interfaceorg.openqa.selenium.support.pagefactory.ElementLocator
-
findElements
- Specified by:
findElements
in interfaceorg.openqa.selenium.support.pagefactory.ElementLocator
-