Class AbstractPage<SELF>
- java.lang.Object
-
- eu.tsystems.mms.tic.testframework.pageobjects.internal.AbstractPage<SELF>
-
- All Implemented Interfaces:
eu.tsystems.mms.tic.testframework.internal.Nameable<SELF>,eu.tsystems.mms.tic.testframework.logging.Loggable,PageCreator,LocatorFactoryProvider,PageObject<SELF>,eu.tsystems.mms.tic.testframework.testing.TestControllerProvider,WebDriverRetainer
- Direct Known Subclasses:
AbstractComponent,Page
public abstract class AbstractPage<SELF> extends java.lang.Object implements eu.tsystems.mms.tic.testframework.logging.Loggable, eu.tsystems.mms.tic.testframework.testing.TestControllerProvider, PageObject<SELF>, LocatorFactoryProvider, PageCreator
This is an abstract page object used forPageandAbstractComponent. Provides basicPageObjectrelated features: Supports elementCheckSupportsPageOptionsLivecycle methods forcheckUiElements(CheckRule):checkPagePreparation()addCustomFieldActions(java.lang.reflect.Field, eu.tsystems.mms.tic.testframework.pageobjects.internal.AbstractPage)assertPageIsNotShown()orassertPageIsNotShown()checkPageErrorState(Throwable)
-
-
Field Summary
Fields Modifier and Type Field Description protected static PageFactorypageFactory-
Fields inherited from interface eu.tsystems.mms.tic.testframework.pageobjects.LocatorFactoryProvider
LOCATE
-
-
Constructor Summary
Constructors Constructor Description AbstractPage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.Optional<java.util.List<AbstractFieldAction>>addCustomFieldActions(java.lang.reflect.Field field, AbstractPage declaringPage)voidassertPageIsNotShown()Deprecated.voidassertPageIsShown()Deprecated.voidcheckPage()Deprecated.Don't call this method on your own and usePageFactory.create(Class, WebDriver)orPageAssertions.displayed(boolean)insteadprotected voidcheckPageErrorState(java.lang.Throwable throwable)Method entered when checkPage runs into an error (catching any throwable).protected voidcheckPagePreparation()Allows pages to run code before performing checkpageprotected <T extends Component>
TcreateComponent(java.lang.Class<T> componentClass, UiElement rootElement)protected UiElementcreateEmpty()protected UiElementcreateEmpty(Locator locator)<T extends Page>
TcreatePage(java.lang.Class<T> pageClass)protected abstract UiElementfind(Locator locator)protected UiElementfind(XPath xPath)protected UiElementfind(org.openqa.selenium.By by)protected UiElementfindById(java.lang.Object id)protected UiElementfindByQa(java.lang.String qa)protected abstract UiElementfindDeep(Locator locator)protected UiElementfindDeep(XPath xPath)protected UiElementfindDeep(org.openqa.selenium.By by)abstract java.lang.StringgetName(boolean detailed)abstract org.openqa.selenium.WebDrivergetWebDriver()protected voidpageLoaded()<T extends Page>
java.util.Optional<T>waitForPage(java.lang.Class<T> pageClass, int seconds)-
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, getParent, hasOwnName, setName, 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.PageObject
screenshotToReport
-
-
-
-
Field Detail
-
pageFactory
protected static final PageFactory pageFactory
-
-
Method Detail
-
findById
protected UiElement findById(java.lang.Object id)
-
findByQa
protected UiElement findByQa(java.lang.String qa)
-
find
protected UiElement find(org.openqa.selenium.By by)
-
findDeep
protected UiElement findDeep(org.openqa.selenium.By by)
-
createEmpty
protected UiElement createEmpty()
-
checkPage
@Deprecated public final void checkPage()
Deprecated.Don't call this method on your own and usePageFactory.create(Class, WebDriver)orPageAssertions.displayed(boolean)insteadThe call of this method is injected into the constructor of every page class or must be called from every page class constructor!!! If there are several subclasses each calling checkPage, it will be only called from the class of the calling instance.
-
getName
public abstract java.lang.String getName(boolean detailed)
- Specified by:
getNamein interfaceeu.tsystems.mms.tic.testframework.internal.Nameable<SELF>
-
checkPagePreparation
protected void checkPagePreparation()
Allows pages to run code before performing checkpage
-
pageLoaded
protected void pageLoaded()
-
checkPageErrorState
protected void checkPageErrorState(java.lang.Throwable throwable) throws java.lang.ThrowableMethod entered when checkPage runs into an error (catching any throwable). You can throw a new throwable that should be stacked onto the checkpage error (like new RuntimeException("bla", throwable) ).- Parameters:
throwable- .- Throws:
java.lang.Throwable- .
-
addCustomFieldActions
protected java.util.Optional<java.util.List<AbstractFieldAction>> addCustomFieldActions(java.lang.reflect.Field field, AbstractPage declaringPage)
-
assertPageIsShown
@Deprecated public void assertPageIsShown()
Deprecated.Empty method to be overriden. Can perform some (additional) checks on page objects.
-
assertPageIsNotShown
@Deprecated public void assertPageIsNotShown()
Deprecated.
-
getWebDriver
public abstract org.openqa.selenium.WebDriver getWebDriver()
- Specified by:
getWebDriverin interfaceWebDriverRetainer
-
createComponent
protected <T extends Component> T createComponent(java.lang.Class<T> componentClass, UiElement rootElement)
-
createPage
public <T extends Page> T createPage(java.lang.Class<T> pageClass)
- Specified by:
createPagein interfacePageCreator
-
waitForPage
public <T extends Page> java.util.Optional<T> waitForPage(java.lang.Class<T> pageClass, int seconds)
- Specified by:
waitForPagein interfacePageCreator
-
-