Class AbstractComponent<SELF extends AbstractComponent<SELF>>
- java.lang.Object
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.AbstractPage<SELF>
-
- eu.tsystems.mms.tic.testframework.pageobjects.AbstractComponent<SELF>
-
- All Implemented Interfaces:
eu.tsystems.mms.tic.testframework.internal.Nameable<SELF>,eu.tsystems.mms.tic.testframework.logging.Loggable,Component<SELF>,UiElementBase,PageCreator,WebElementActions,WebElementRetainer,LocatorFactoryProvider,PageObject<SELF>,eu.tsystems.mms.tic.testframework.testing.TestControllerProvider,WebDriverRetainer
public abstract class AbstractComponent<SELF extends AbstractComponent<SELF>> extends AbstractPage<SELF> implements Component<SELF>
Components are wrappers for HTML elements like WebComponents that acts like aUiElementandPageObject
-
-
Field Summary
Fields Modifier and Type Field Description protected UiElementrootElementprotected static UiElementFactoryuiElementFactory-
Fields inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.AbstractPage
pageFactory
-
Fields inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.LocatorFactoryProvider
LOCATE
-
-
Constructor Summary
Constructors Constructor Description AbstractComponent(UiElement rootElement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateXPath()Creates a xpath of the givenLocatorhierarchy NOT the actual element hierarchyUiElementBaseAssertionexpect()ThrowsAssertionErrorwhen condition not matchedprotected UiElementfind(Locator locator)protected UiElementfindDeep(Locator locator)voidfindWebElement(java.util.function.Consumer<org.openqa.selenium.WebElement> consumer)Supplies the first found filteredWebElementto a consumer.LocatorgetLocator()java.lang.StringgetName(boolean detailed)eu.tsystems.mms.tic.testframework.internal.NameablegetParent()org.openqa.selenium.WebDrivergetWebDriver()booleanhasOwnName()InteractiveUiElementhighlight(java.awt.Color color)Highlights the element with a specified colorUiElementList<SELF>list()voidscreenshotToReport()InteractiveUiElementscrollIntoView(org.openqa.selenium.Point offset)Centers the element in the viewport with a given offsetInteractiveUiElementscrollToTop()Scroll the element to the top of the viewportSELFsetName(java.lang.String name)UiElementBaseAssertionwaitFor(int seconds)Doesn't throw anyAssertionError-
Methods inherited from class eu.tsystems.mms.tic.testframework.pageobjects.internal.AbstractPage
addCustomFieldActions, assertPageIsNotShown, assertPageIsShown, checkPage, checkPageErrorState, checkPagePreparation, createComponent, createEmpty, createEmpty, createPage, find, find, findById, findByQa, findDeep, findDeep, pageLoaded, waitForPage
-
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.internal.Nameable
getName, toString, traceAncestors
-
Methods inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.internal.PageCreator
waitForPage
-
Methods inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.internal.core.UiElementBase
assertThat, waitFor
-
Methods inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.internal.WebElementActions
highlight, scrollIntoView
-
-
-
-
Field Detail
-
uiElementFactory
protected static final UiElementFactory uiElementFactory
-
rootElement
protected final UiElement rootElement
-
-
Constructor Detail
-
AbstractComponent
public AbstractComponent(UiElement rootElement)
-
-
Method Detail
-
highlight
public InteractiveUiElement highlight(java.awt.Color color)
Description copied from interface:WebElementActionsHighlights the element with a specified color- Specified by:
highlightin interfaceWebElementActions
-
createXPath
public java.lang.String createXPath()
Description copied from interface:UiElementBaseCreates a xpath of the givenLocatorhierarchy NOT the actual element hierarchy- Specified by:
createXPathin interfaceUiElementBase
-
getLocator
public Locator getLocator()
- Specified by:
getLocatorin interfaceUiElementBase
-
scrollIntoView
public InteractiveUiElement scrollIntoView(org.openqa.selenium.Point offset)
Description copied from interface:WebElementActionsCenters the element in the viewport with a given offset- Specified by:
scrollIntoViewin interfaceWebElementActions
-
scrollToTop
public InteractiveUiElement scrollToTop()
Description copied from interface:WebElementActionsScroll the element to the top of the viewport- Specified by:
scrollToTopin interfaceWebElementActions
-
list
public UiElementList<SELF> list()
- Specified by:
listin interfaceComponent<SELF extends AbstractComponent<SELF>>
-
find
protected UiElement find(Locator locator)
- Specified by:
findin classAbstractPage<SELF extends AbstractComponent<SELF>>
-
findDeep
protected UiElement findDeep(Locator locator)
- Specified by:
findDeepin classAbstractPage<SELF extends AbstractComponent<SELF>>
-
getWebDriver
public org.openqa.selenium.WebDriver getWebDriver()
- Specified by:
getWebDriverin interfaceWebDriverRetainer- Specified by:
getWebDriverin classAbstractPage<SELF extends AbstractComponent<SELF>>
-
waitFor
public UiElementBaseAssertion waitFor(int seconds)
Description copied from interface:UiElementBaseDoesn't throw anyAssertionError- Specified by:
waitForin interfaceUiElementBase
-
expect
public UiElementBaseAssertion expect()
Description copied from interface:UiElementBaseThrowsAssertionErrorwhen condition not matched- Specified by:
expectin interfaceUiElementBase
-
setName
public SELF setName(java.lang.String name)
- Specified by:
setNamein interfaceeu.tsystems.mms.tic.testframework.internal.Nameable<SELF extends AbstractComponent<SELF>>
-
getName
public java.lang.String getName(boolean detailed)
- Specified by:
getNamein interfaceeu.tsystems.mms.tic.testframework.internal.Nameable<SELF extends AbstractComponent<SELF>>- Specified by:
getNamein classAbstractPage<SELF extends AbstractComponent<SELF>>
-
getParent
public eu.tsystems.mms.tic.testframework.internal.Nameable getParent()
- Specified by:
getParentin interfaceeu.tsystems.mms.tic.testframework.internal.Nameable<SELF extends AbstractComponent<SELF>>
-
hasOwnName
public boolean hasOwnName()
- Specified by:
hasOwnNamein interfaceeu.tsystems.mms.tic.testframework.internal.Nameable<SELF extends AbstractComponent<SELF>>
-
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
-
screenshotToReport
public void screenshotToReport()
- Specified by:
screenshotToReportin interfacePageObject<SELF extends AbstractComponent<SELF>>
-
-