Package com.qaprosoft.carina.core.gui
Class AbstractPage
- java.lang.Object
-
- com.qaprosoft.carina.core.foundation.webdriver.DriverHelper
-
- com.qaprosoft.carina.core.gui.AbstractUIObject
-
- com.qaprosoft.carina.core.gui.AbstractPage
-
- All Implemented Interfaces:
IDriverPool
,ICustomTypePageFactory
- Direct Known Subclasses:
MobileAbstractPage
public abstract class AbstractPage extends AbstractUIObject implements ICustomTypePageFactory
All page POJO objects should extend this abstract page to get extra logic.- Author:
- Alex Khursevich
-
-
Field Summary
-
Fields inherited from class com.qaprosoft.carina.core.gui.AbstractUIObject
name, rootBy, rootElement, uiLoadedMarker
-
Fields inherited from class com.qaprosoft.carina.core.foundation.webdriver.DriverHelper
CRYPTO_PATTERN, cryptoTool, driver, EXPLICIT_TIMEOUT, pageURL, RETRY_TIME, SHORT_TIMEOUT, timer
-
Fields inherited from interface com.zebrunner.carina.utils.factory.ICustomTypePageFactory
DOUBLE_OBJ_STR, DOUBLE_STR, INT_STR, INTEGER_STR, LONG_OBJ_STR, LONG_STR, PAGEFACTORY_LOGGER, REFLECTIONS, VERSION_SPLITTER
-
Fields inherited from interface com.qaprosoft.carina.core.foundation.webdriver.IDriverPool
currentDevice, customCapabilities, DEFAULT, driversMap, driversPool, nullDevice, POOL_LOGGER
-
-
Constructor Summary
Constructors Constructor Description AbstractPage(org.openqa.selenium.WebDriver driver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertPageOpened()
Asserts whether page is opened or not.void
assertPageOpened(long timeout)
Asserts whether page is opened or not.PageOpeningStrategy
getPageOpeningStrategy()
boolean
isPageOpened()
boolean
isPageOpened(long timeout)
java.lang.String
savePageAsPdf(boolean scaled, java.lang.String fileName)
Save page as pdf
If you want to set fileName as test name, use TestNamingService.getTestName()java.lang.String
savePageAsPdf(java.lang.String fileName)
Save page as pdf
If you want to set fileName as test name, use TestNamingService.getTestName()void
setPageOpeningStrategy(PageOpeningStrategy pageOpeningStrategy)
void
waitForJSToLoad()
Waits till JS and jQuery (if applicable for the page) are completely processed on the pagevoid
waitForJSToLoad(long timeout)
Waits till JS and jQuery (if applicable for the page) are completely processed on the page-
Methods inherited from class com.qaprosoft.carina.core.gui.AbstractUIObject
assertUIObjectNotPresent, assertUIObjectNotPresent, assertUIObjectPresent, assertUIObjectPresent, getLoadingStrategy, getName, getRootBy, getRootElement, getRootExtendedElement, getUiLoadedMarker, isUIObjectPresent, isUIObjectPresent, setLoadingStrategy, setName, setRootBy, setRootElement, setRootExtendedElement, setUiLoadedMarker
-
Methods inherited from class com.qaprosoft.carina.core.foundation.webdriver.DriverHelper
acceptAlert, addCookie, allElementListsAreNotEmpty, allElementListsAreNotEmpty, allElementsPresent, allElementsPresent, assertElementPresent, assertElementPresent, assertElementWithTextPresent, assertElementWithTextPresent, cancelAlert, clickAny, clickAny, dragAndDrop, dragAndDropHtml5, findExtendedWebElement, findExtendedWebElement, findExtendedWebElement, findExtendedWebElement, findExtendedWebElements, findExtendedWebElements, getClipboardText, getCurrentUrl, getCurrentUrl, getDriver, getPageSource, getPageURL, getTitle, getTitle, isAlertPresent, isAnyElementPresent, isAnyElementPresent, isElementNotPresent, isElementNotPresent, isElementNotPresent, isElementWithTextPresent, isElementWithTextPresent, isPageOpened, isPageOpened, isTitleAsExpected, isTitleAsExpectedPattern, isUrlAsExpected, isUrlAsExpected, navigateBack, open, openTab, openURL, openURL, pause, pause, performIgnoreException, pressTab, refresh, refresh, returnAnyPresentElement, returnAnyPresentElement, setClipboardText, setDriver, setPageAbsoluteURL, setPageURL, slide, switchWindow, trigger, trigger, waitUntil
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.zebrunner.carina.utils.factory.ICustomTypePageFactory
comparePrimitives, getConstructorByParams, initPage, initPage
-
Methods inherited from interface com.qaprosoft.carina.core.foundation.webdriver.IDriverPool
getDevice, getDevice, getDevice, getDriver, getDriver, getDriver, getDriver, getDriver, getDrivers, isDeviceRegistered, isDriverRegistered, quitDriver, quitDriver, quitDrivers, removeCapabilities, restartDriver, restartDriver, setCapabilities
-
-
-
-
Method Detail
-
getPageOpeningStrategy
public PageOpeningStrategy getPageOpeningStrategy()
-
setPageOpeningStrategy
public void setPageOpeningStrategy(PageOpeningStrategy pageOpeningStrategy)
-
isPageOpened
public boolean isPageOpened()
-
isPageOpened
public boolean isPageOpened(long timeout)
-
assertPageOpened
public void assertPageOpened()
Asserts whether page is opened or not. Inside there is a check for expected url matches actual page url. In addition if uiLoadedMarker is specified for the page it will check whether mentioned element presents on page or not.
-
assertPageOpened
public void assertPageOpened(long timeout)
Asserts whether page is opened or not. Inside there is a check for expected url matches actual page url. In addition if uiLoadedMarker is specified for the page it will check whether mentioned element presents on page or not.- Parameters:
timeout
- Completing of page loading conditions will be verified within specified timeout
-
savePageAsPdf
public java.lang.String savePageAsPdf(boolean scaled, java.lang.String fileName) throws java.io.IOException, com.itextpdf.text.DocumentException
Save page as pdf
If you want to set fileName as test name, use TestNamingService.getTestName()- Throws:
java.io.IOException
com.itextpdf.text.DocumentException
-
savePageAsPdf
public java.lang.String savePageAsPdf(java.lang.String fileName) throws java.io.IOException, com.itextpdf.text.DocumentException
Save page as pdf
If you want to set fileName as test name, use TestNamingService.getTestName()- Throws:
java.io.IOException
com.itextpdf.text.DocumentException
-
waitForJSToLoad
public void waitForJSToLoad()
Waits till JS and jQuery (if applicable for the page) are completely processed on the page
-
waitForJSToLoad
public void waitForJSToLoad(long timeout)
Waits till JS and jQuery (if applicable for the page) are completely processed on the page- Parameters:
timeout
- Completing of JS loading will be verified within specified timeout
-
-