Class AbstractGuiElementCoreDecorator
- java.lang.Object
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreDecorator
-
- All Implemented Interfaces:
GuiElementCore,GuiElementCoreActions,WebElementRetainer
- Direct Known Subclasses:
DelayActionsGuiElementFacade,GuiElementCoreSequenceDecorator,UiElementLogger
public abstract class AbstractGuiElementCoreDecorator extends AbstractGuiElementCoreActionsDecorator implements GuiElementCore
Abstract decorator for aGuiElementCore
-
-
Field Summary
-
Fields inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
decoratedCore
-
-
Constructor Summary
Constructors Constructor Description AbstractGuiElementCoreDecorator(GuiElementCore decoratedCore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterDelegation()protected voidbeforeDelegation(java.lang.String method, java.lang.Object... params)voidfindWebElement(java.util.function.Consumer<org.openqa.selenium.WebElement> consumer)Supplies the first found filteredWebElementto a consumer.java.lang.StringgetAttribute(java.lang.String attributeName)WebElement.getAttribute.java.lang.StringgetCssValue(java.lang.String cssIdentifier)WebElement.getCssValue.intgetLengthOfValueAfterSendKeys(java.lang.String textToInput)Types your text and returns the length of the attribute 'value' afterwards.org.openqa.selenium.PointgetLocation()WebElement.getLocation.intgetNumberOfFoundElements()A given location strategy (Locator + WebElementFilter) can match to many elements in a Website.org.openqa.selenium.RectanglegetRect()Gets the element's rectangleorg.openqa.selenium.DimensiongetSize()WebElement.getSize.java.lang.StringgetTagName()WebElement.getTagName.java.lang.StringgetText()Calls WebElement.getText.java.util.List<java.lang.String>getTextsFromChildren()Returns with all texts of child-elements.booleanisDisplayed()WebElement.isDisplayed.booleanisEnabled()WebElement.isEnabled.booleanisPresent()Checks if an element is found by webdriver.booleanisSelectable()Checks if the element is selectable.booleanisSelected()WebElement.isSelected.booleanisVisible(boolean fullyVisible)Checks if the element is visible in the current viewportjava.io.FiletakeScreenshot()Takes a screenshot of the GuiElement-
Methods inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
clear, click, contextClick, deselect, doubleClick, highlight, hover, scrollIntoView, scrollToElement, scrollToTop, select, sendKeys, submit, swipe, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.internal.core.GuiElementCore
getWebElement
-
Methods inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.internal.core.GuiElementCoreActions
clear, click, contextClick, deselect, doubleClick, highlight, hover, mouseOver, rightClick, scrollIntoView, scrollIntoView, scrollToElement, scrollToElement, scrollToTop, select, select, sendKeys, submit, swipe, type
-
-
-
-
Constructor Detail
-
AbstractGuiElementCoreDecorator
public AbstractGuiElementCoreDecorator(GuiElementCore decoratedCore)
-
-
Method Detail
-
beforeDelegation
protected void beforeDelegation(java.lang.String method, java.lang.Object... params)- Overrides:
beforeDelegationin classAbstractGuiElementCoreActionsDecorator
-
afterDelegation
protected void afterDelegation()
- Overrides:
afterDelegationin classAbstractGuiElementCoreActionsDecorator
-
isPresent
public boolean isPresent()
Description copied from interface:GuiElementCoreChecks if an element is found by webdriver.- Specified by:
isPresentin interfaceGuiElementCore- Returns:
- true if found, false otherwise.
-
isEnabled
public boolean isEnabled()
Description copied from interface:GuiElementCoreWebElement.isEnabled.- Specified by:
isEnabledin interfaceGuiElementCore- Returns:
- true if element is enabled.
-
isDisplayed
public boolean isDisplayed()
Description copied from interface:GuiElementCoreWebElement.isDisplayed.- Specified by:
isDisplayedin interfaceGuiElementCore- Returns:
- true if element is displayed.
-
isSelected
public boolean isSelected()
Description copied from interface:GuiElementCoreWebElement.isSelected.- Specified by:
isSelectedin interfaceGuiElementCore- Returns:
- true if element is selected.
-
getText
public java.lang.String getText()
Description copied from interface:GuiElementCoreCalls WebElement.getText. Please note that this will only return a String, if the elements text is actually visible.- Specified by:
getTextin interfaceGuiElementCore- Returns:
- text of the element.
-
getAttribute
public java.lang.String getAttribute(java.lang.String attributeName)
Description copied from interface:GuiElementCoreWebElement.getAttribute.- Specified by:
getAttributein interfaceGuiElementCore- Parameters:
attributeName- Name of the attribute.- Returns:
- The value of the attribute.
-
getRect
public org.openqa.selenium.Rectangle getRect()
Description copied from interface:GuiElementCoreGets the element's rectangle- Specified by:
getRectin interfaceGuiElementCore
-
isSelectable
public boolean isSelectable()
Description copied from interface:GuiElementCoreChecks if the element is selectable.- Specified by:
isSelectablein interfaceGuiElementCore- Returns:
- ture, if the element is selectable
-
findWebElement
public void findWebElement(java.util.function.Consumer<org.openqa.selenium.WebElement> consumer)
Description copied from interface:WebElementRetainerSupplies the first found filteredWebElementto a consumer. This makes sure that the element is present it it's current scope and not stale- Specified by:
findWebElementin interfaceWebElementRetainer
-
getTagName
public java.lang.String getTagName()
Description copied from interface:GuiElementCoreWebElement.getTagName.- Specified by:
getTagNamein interfaceGuiElementCore- Returns:
- The tag name as String.
-
getLocation
public org.openqa.selenium.Point getLocation()
Description copied from interface:GuiElementCoreWebElement.getLocation.- Specified by:
getLocationin interfaceGuiElementCore- Returns:
- The location of the webelement.
-
getSize
public org.openqa.selenium.Dimension getSize()
Description copied from interface:GuiElementCoreWebElement.getSize.- Specified by:
getSizein interfaceGuiElementCore- Returns:
- Size of the webelement.
-
getCssValue
public java.lang.String getCssValue(java.lang.String cssIdentifier)
Description copied from interface:GuiElementCoreWebElement.getCssValue.- Specified by:
getCssValuein interfaceGuiElementCore- Parameters:
cssIdentifier- .- Returns:
- Css value of the webelement.
-
getTextsFromChildren
public java.util.List<java.lang.String> getTextsFromChildren()
Description copied from interface:GuiElementCoreReturns with all texts of child-elements.- Specified by:
getTextsFromChildrenin interfaceGuiElementCore- Returns:
- .
-
getLengthOfValueAfterSendKeys
public int getLengthOfValueAfterSendKeys(java.lang.String textToInput)
Description copied from interface:GuiElementCoreTypes your text and returns the length of the attribute 'value' afterwards. Can be useful to check a maximal input length- Specified by:
getLengthOfValueAfterSendKeysin interfaceGuiElementCore- Parameters:
textToInput- text to check- Returns:
- Length of the attribute 'value'
- See Also:
*
-
getNumberOfFoundElements
public int getNumberOfFoundElements()
Description copied from interface:GuiElementCoreA given location strategy (Locator + WebElementFilter) can match to many elements in a Website. This method returns that number. This can be useful for tests, that want to ensure that a GuiElement is found n times.- Specified by:
getNumberOfFoundElementsin interfaceGuiElementCore- Returns:
- The number, how many WebElements were identified by this GuiElement.
-
takeScreenshot
public java.io.File takeScreenshot()
Description copied from interface:GuiElementCoreTakes a screenshot of the GuiElement- Specified by:
takeScreenshotin interfaceGuiElementCore- Returns:
- File object of the screenshot or NULL on error
-
isVisible
public boolean isVisible(boolean fullyVisible)
Description copied from interface:GuiElementCoreChecks if the element is visible in the current viewport- Specified by:
isVisiblein interfaceGuiElementCore- Returns:
-
-