Class GuiElementCoreSequenceDecorator
- java.lang.Object
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreDecorator
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.core.GuiElementCoreSequenceDecorator
-
- All Implemented Interfaces:
eu.tsystems.mms.tic.testframework.logging.Loggable,GuiElementCore,GuiElementCoreActions,WebElementRetainer
public class GuiElementCoreSequenceDecorator extends AbstractGuiElementCoreDecorator implements eu.tsystems.mms.tic.testframework.logging.Loggable
Wraps core methods into sequences, to improve stability. Some status methods (the is... methods that return boolean) should, in contrast return the status immediately, without retry in a sequence.Created by rnhb on 12.08.2015.
-
-
Field Summary
-
Fields inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
decoratedCore
-
-
Constructor Summary
Constructors Constructor Description GuiElementCoreSequenceDecorator(GuiElementCore core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclick()voiddeselect()voiddoubleClick()doubleclickvoidfindWebElement(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.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.voidhighlight(java.awt.Color color)voidhover()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 viewportvoidscrollIntoView(org.openqa.selenium.Point offset)voidscrollToElement(int yOffset)voidselect()voidsendKeys(java.lang.CharSequence... charSequences)voidsubmit()voidswipe(int offsetX, int offSetY)Swipe the element by the given offset.java.io.FiletakeScreenshot()Takes a screenshot of the GuiElementvoidtype(java.lang.String text)-
Methods inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreDecorator
afterDelegation, beforeDelegation, getRect
-
Methods inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.core.AbstractGuiElementCoreActionsDecorator
contextClick, scrollToTop
-
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
contextClick, mouseOver, rightClick, scrollIntoView, scrollToElement, scrollToTop, select
-
-
-
-
Constructor Detail
-
GuiElementCoreSequenceDecorator
public GuiElementCoreSequenceDecorator(GuiElementCore core)
-
-
Method Detail
-
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- Overrides:
findWebElementin classAbstractGuiElementCoreDecorator
-
scrollToElement
public void scrollToElement(int yOffset)
- Specified by:
scrollToElementin interfaceGuiElementCoreActions- Overrides:
scrollToElementin classAbstractGuiElementCoreActionsDecorator
-
scrollIntoView
public void scrollIntoView(org.openqa.selenium.Point offset)
- Specified by:
scrollIntoViewin interfaceGuiElementCoreActions- Overrides:
scrollIntoViewin classAbstractGuiElementCoreActionsDecorator
-
hover
public void hover()
- Specified by:
hoverin interfaceGuiElementCoreActions- Overrides:
hoverin classAbstractGuiElementCoreActionsDecorator
-
select
public void select()
- Specified by:
selectin interfaceGuiElementCoreActions- Overrides:
selectin classAbstractGuiElementCoreActionsDecorator
-
deselect
public void deselect()
- Specified by:
deselectin interfaceGuiElementCoreActions- Overrides:
deselectin classAbstractGuiElementCoreActionsDecorator
-
type
public void type(java.lang.String text)
- Specified by:
typein interfaceGuiElementCoreActions- Overrides:
typein classAbstractGuiElementCoreActionsDecorator
-
click
public void click()
- Specified by:
clickin interfaceGuiElementCoreActions- Overrides:
clickin classAbstractGuiElementCoreActionsDecorator
-
submit
public void submit()
- Specified by:
submitin interfaceGuiElementCoreActions- Overrides:
submitin classAbstractGuiElementCoreActionsDecorator
-
sendKeys
public void sendKeys(java.lang.CharSequence... charSequences)
- Specified by:
sendKeysin interfaceGuiElementCoreActions- Overrides:
sendKeysin classAbstractGuiElementCoreActionsDecorator
-
clear
public void clear()
- Specified by:
clearin interfaceGuiElementCoreActions- Overrides:
clearin classAbstractGuiElementCoreActionsDecorator
-
getTagName
public java.lang.String getTagName()
Description copied from interface:GuiElementCoreWebElement.getTagName.- Specified by:
getTagNamein interfaceGuiElementCore- Overrides:
getTagNamein classAbstractGuiElementCoreDecorator- Returns:
- The tag name as String.
-
getLocation
public org.openqa.selenium.Point getLocation()
Description copied from interface:GuiElementCoreWebElement.getLocation.- Specified by:
getLocationin interfaceGuiElementCore- Overrides:
getLocationin classAbstractGuiElementCoreDecorator- Returns:
- The location of the webelement.
-
getSize
public org.openqa.selenium.Dimension getSize()
Description copied from interface:GuiElementCoreWebElement.getSize.- Specified by:
getSizein interfaceGuiElementCore- Overrides:
getSizein classAbstractGuiElementCoreDecorator- 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- Overrides:
getCssValuein classAbstractGuiElementCoreDecorator- 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- Overrides:
getTextsFromChildrenin classAbstractGuiElementCoreDecorator- Returns:
- .
-
doubleClick
public void doubleClick()
Description copied from interface:GuiElementCoreActionsdoubleclick- Specified by:
doubleClickin interfaceGuiElementCoreActions- Overrides:
doubleClickin classAbstractGuiElementCoreActionsDecorator
-
highlight
public void highlight(java.awt.Color color)
- Specified by:
highlightin interfaceGuiElementCoreActions- Overrides:
highlightin classAbstractGuiElementCoreActionsDecorator
-
swipe
public void swipe(int offsetX, int offSetY)Description copied from interface:GuiElementCoreActionsSwipe the element by the given offset. (0,0) should be the top left.- Specified by:
swipein interfaceGuiElementCoreActions- Overrides:
swipein classAbstractGuiElementCoreActionsDecorator- Parameters:
offsetX- horizontal offset in pixel.offSetY- vertical offset in pixel.
-
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- Overrides:
getLengthOfValueAfterSendKeysin classAbstractGuiElementCoreDecorator- 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- Overrides:
getNumberOfFoundElementsin classAbstractGuiElementCoreDecorator- 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- Overrides:
takeScreenshotin classAbstractGuiElementCoreDecorator- Returns:
- File object of the screenshot or NULL on error
-
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- Overrides:
getTextin classAbstractGuiElementCoreDecorator- 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- Overrides:
getAttributein classAbstractGuiElementCoreDecorator- Parameters:
attributeName- Name of the attribute.- Returns:
- The value of the attribute.
-
isPresent
public boolean isPresent()
Description copied from interface:GuiElementCoreChecks if an element is found by webdriver.- Specified by:
isPresentin interfaceGuiElementCore- Overrides:
isPresentin classAbstractGuiElementCoreDecorator- Returns:
- true if found, false otherwise.
-
isEnabled
public boolean isEnabled()
Description copied from interface:GuiElementCoreWebElement.isEnabled.- Specified by:
isEnabledin interfaceGuiElementCore- Overrides:
isEnabledin classAbstractGuiElementCoreDecorator- Returns:
- true if element is enabled.
-
isDisplayed
public boolean isDisplayed()
Description copied from interface:GuiElementCoreWebElement.isDisplayed.- Specified by:
isDisplayedin interfaceGuiElementCore- Overrides:
isDisplayedin classAbstractGuiElementCoreDecorator- Returns:
- true if element is displayed.
-
isVisible
public boolean isVisible(boolean fullyVisible)
Description copied from interface:GuiElementCoreChecks if the element is visible in the current viewport- Specified by:
isVisiblein interfaceGuiElementCore- Overrides:
isVisiblein classAbstractGuiElementCoreDecorator- Returns:
-
isSelected
public boolean isSelected()
Description copied from interface:GuiElementCoreWebElement.isSelected.- Specified by:
isSelectedin interfaceGuiElementCore- Overrides:
isSelectedin classAbstractGuiElementCoreDecorator- Returns:
- true if element is selected.
-
isSelectable
public boolean isSelectable()
Description copied from interface:GuiElementCoreChecks if the element is selectable.- Specified by:
isSelectablein interfaceGuiElementCore- Overrides:
isSelectablein classAbstractGuiElementCoreDecorator- Returns:
- ture, if the element is selectable
-
-