Package io.meeds.qa.ui.elements
Class ElementFacadeImpl
java.lang.Object
net.serenitybdd.core.pages.WebElementFacadeImpl
io.meeds.qa.ui.elements.ElementFacadeImpl
- All Implemented Interfaces:
ElementFacade,net.serenitybdd.core.pages.WebElementFacade,net.serenitybdd.core.pages.WebElementState,net.thucydides.core.pages.WebElementFacade,net.thucydides.core.pages.WebElementState,net.thucydides.core.webdriver.ConfigurableTimeouts,org.openqa.selenium.interactions.Locatable,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
- Direct Known Subclasses:
ButtonElementFacadeImpl,TextBoxElementFacadeImpl,TextElementFacadeImpl
public class ElementFacadeImpl
extends net.serenitybdd.core.pages.WebElementFacadeImpl
implements ElementFacade
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.Loggerprotected org.openqa.selenium.WebElementprotected final StringFields inherited from class net.serenitybdd.core.pages.WebElementFacadeImpl
NUMBER_OF_TRIES_FOR_UNREADY_ELEMENTS -
Constructor Summary
ConstructorsConstructorDescriptionElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckXpathFormat(String xpath) Methods for finding element facade inside of this elementvoidclick()Wrapper which is meant to click on a clickable element.findByXPath(String xpath) Method to find an element inside an element using the xpath and to wrapp it in a BaseElementFacade instanceprotected net.serenitybdd.core.pages.WebElementFacadefindSubElementFacadeByXPathOrCSS(String xpathOrCss) org.openqa.selenium.WebDriverorg.openqa.selenium.WebElementprotected net.serenitybdd.core.pages.WebElementFacadegetWebElementFacadeByXPathOrCSS(String xpathOrCss) voidhover()this method is to make the mouse hover over the selected element.booleanbooleanbooleanthis method will check if element is displayed or not without implicit timeoutbooleanbooleanbooleanisElementNotVisible(long implicitWaitInMillis) booleanisElementVisible(long implicitWaitInMillis) booleanbooleanIs this web element present and not visible on the screen This method will not throw an exception if the element is visible.booleanbooleanvoidThis method will scroll down the elementvoidThis method will scroll the element to the rightvoidThis method will scroll up or down until it reaches the web elementnet.serenitybdd.core.pages.WebElementFacadenet.serenitybdd.core.pages.WebElementFacadenet.serenitybdd.core.pages.WebElementFacadestatic ElementFacadeImplwrapWebElementFacade(org.openqa.selenium.WebDriver driver, net.serenitybdd.core.pages.WebElementFacade element, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) This method has the goal of creating a BaseElementFacade instance from a WebElementFacade instance.Methods inherited from class net.serenitybdd.core.pages.WebElementFacadeImpl
and, clear, click, containsElements, containsElements, containsOnlyText, containsSelectOption, containsText, containsValue, contextClick, deselect, deselectAll, deselectByIndex, deselectByValue, deselectByVisibleText, doubleClick, driverIsDisabled, expect, expectingErrorMessage, find, findBy, findBy, findBy, findElement, findElements, findNestedElementsMatching, foundBy, fromWebElements, getAccessibleName, getAriaRole, getAttribute, getClock, getCoordinates, getCssValue, getCurrentImplicitTimeout, getDomAttribute, getDomProperty, getErrorMessage, getFirstSelectedOptionValue, getFirstSelectedOptionVisibleText, getFoundBy, getImplicitTimeout, getImplicitTimeoutInMilliseconds, getJavascriptExecutorFacade, getLocation, getLocator, getRect, getScreenshotAs, getSelectedValue, getSelectedValues, getSelectedVisibleTexts, getSelectedVisibleTextValue, getSelectOptions, getSelectOptionValues, getShadowRoot, getSize, getTagName, getText, getTextContent, getTextValue, getValue, getWrappedElement, hasClass, hasFocus, isSelected, notifyScreenChange, resetTimeouts, select, selectByIndex, selectByValue, selectByVisibleText, sendKeys, setImplicitTimeout, setWindowFocus, shouldBeCurrentlyVisible, shouldBeEnabled, shouldBePresent, shouldBeSelected, shouldBeVisible, shouldContainElements, shouldContainElements, shouldContainOnlyText, shouldContainSelectedOption, shouldContainText, shouldNotBeCurrentlyVisible, shouldNotBeEnabled, shouldNotBePresent, shouldNotBeSelected, shouldNotBeVisible, shouldNotContainText, submit, then, then, then, then, thenFind, thenFind, thenFindAll, thenFindAll, thenFindAll, timeoutInMilliseconds, toString, type, typeAndEnter, typeAndTab, waitForCondition, waitUntilDisabled, waitUntilElementAvailable, waitUntilElementPresent, waitUntilEnabled, waitUntilPresent, withTimeoutOf, withTimeoutOf, withTimeoutOf, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.thucydides.core.webdriver.ConfigurableTimeouts
getCurrentImplicitTimeout, resetTimeouts, setImplicitTimeoutMethods inherited from interface io.meeds.qa.ui.elements.ElementFacade
assertDisabled, assertEnabled, assertNotVisible, assertVisible, checkClickable, checkCurrentlyVisible, checkEnabled, checkNotVisible, checkPresent, checkVisibleMethods inherited from interface org.openqa.selenium.interactions.Locatable
getCoordinatesMethods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAsMethods inherited from interface org.openqa.selenium.WebElement
findElement, findElements, getAccessibleName, getAriaRole, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, isSelected, sendKeys, submitMethods inherited from interface net.serenitybdd.core.pages.WebElementFacade
and, clear, click, containsElements, containsElements, contextClick, deselect, deselectAll, deselectByIndex, deselectByValue, deselectByVisibleText, doubleClick, find, findBy, findBy, findBy, findNestedElementsMatching, getAttribute, getFirstSelectedOptionValue, getFirstSelectedOptionVisibleText, getImplicitTimeoutInMilliseconds, getSelectedValues, getSelectedVisibleTexts, getSelectOptions, getSelectOptionValues, getText, getTextContent, getValue, hasClass, select, selectByIndex, selectByValue, selectByVisibleText, setWindowFocus, shouldContainElements, shouldContainElements, then, then, then, then, thenFind, thenFind, thenFindAll, thenFindAll, thenFindAll, toString, type, typeAndEnter, typeAndTab, waitForCondition, waitUntilDisabled, waitUntilEnabled, waitUntilPresent, withTimeoutOf, withTimeoutOf, withTimeoutOfMethods inherited from interface net.serenitybdd.core.pages.WebElementState
containsOnlyText, containsSelectOption, containsText, containsValue, expect, getSelectedValue, getSelectedVisibleTextValue, getTextValue, hasFocus, isSelected, shouldBeCurrentlyVisible, shouldBeEnabled, shouldBePresent, shouldBeSelected, shouldBeVisible, shouldContainOnlyText, shouldContainSelectedOption, shouldContainText, shouldNotBeCurrentlyVisible, shouldNotBeEnabled, shouldNotBePresent, shouldNotBeSelected, shouldNotBeVisible, shouldNotContainTextMethods inherited from interface org.openqa.selenium.WrapsElement
getWrappedElement
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER -
webElement
protected org.openqa.selenium.WebElement webElement -
xPathOrCSSSelector
-
-
Constructor Details
-
ElementFacadeImpl
public ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) -
ElementFacadeImpl
public ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
-
-
Method Details
-
wrapWebElementFacade
public static ElementFacadeImpl wrapWebElementFacade(org.openqa.selenium.WebDriver driver, net.serenitybdd.core.pages.WebElementFacade element, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) This method has the goal of creating a BaseElementFacade instance from a WebElementFacade instance. Consequently, it would have the access to the BaseElementFacade interface methods- Parameters:
driver-WebDriverelement-WebElementFacadelocator-ElementLocatorxPathOrCSSSelector- used xPath or CSS selector to find elementimplicitTimeoutInMilliseconds- configured implicit timeoutwaitForTimeoutInMilliseconds- configured general timeout- Returns:
- a wrapped
ElementFacadeImplof the webElementFacade
-
click
public void click()Description copied from interface:ElementFacadeWrapper which is meant to click on a clickable element.- Specified by:
clickin interfaceElementFacade- Specified by:
clickin interfaceorg.openqa.selenium.WebElement- Specified by:
clickin interfacenet.serenitybdd.core.pages.WebElementFacade- Overrides:
clickin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
findByXPath
Description copied from interface:ElementFacadeMethod to find an element inside an element using the xpath and to wrapp it in a BaseElementFacade instance- Specified by:
findByXPathin interfaceElementFacade- Parameters:
xpath- XPath of Sub element- Returns:
- BaseElementFacade instance of the found element
-
getDriver
public org.openqa.selenium.WebDriver getDriver()- Specified by:
getDriverin interfaceElementFacade- Returns:
- currently used
WebDriver
-
getElement
public org.openqa.selenium.WebElement getElement()- Specified by:
getElementin interfacenet.serenitybdd.core.pages.WebElementFacade- Overrides:
getElementin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
hover
public void hover()Description copied from interface:ElementFacadethis method is to make the mouse hover over the selected element.- Specified by:
hoverin interfaceElementFacade
-
isClickable
public boolean isClickable()- Specified by:
isClickablein interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isClickablein classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isCurrentlyEnabled
public boolean isCurrentlyEnabled()- Specified by:
isCurrentlyEnabledin interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isCurrentlyEnabledin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isCurrentlyVisible
public boolean isCurrentlyVisible()Description copied from interface:ElementFacadethis method will check if element is displayed or not without implicit timeout- Specified by:
isCurrentlyVisiblein interfaceElementFacade- Specified by:
isCurrentlyVisiblein interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isCurrentlyVisiblein classnet.serenitybdd.core.pages.WebElementFacadeImpl- Returns:
- true if displayed else false
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabledin interfacenet.serenitybdd.core.pages.WebElementFacade- Specified by:
isDisabledin interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isDisabledin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayedin interfaceorg.openqa.selenium.WebElement- Overrides:
isDisplayedin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isElementNotVisible
public boolean isElementNotVisible(long implicitWaitInMillis) -
isElementVisible
public boolean isElementVisible(long implicitWaitInMillis) -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.openqa.selenium.WebElement- Specified by:
isEnabledin interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isEnabledin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isNotVisible
public boolean isNotVisible()Description copied from interface:ElementFacadeIs this web element present and not visible on the screen This method will not throw an exception if the element is visible. If the element is visible, the method will wait a bit to see if it appears later on.- Specified by:
isNotVisiblein interfaceElementFacade- Returns:
- true if not visible else false
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isPresentin classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein interfacenet.serenitybdd.core.pages.WebElementState- Overrides:
isVisiblein classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
scrollDown
public void scrollDown()Description copied from interface:ElementFacadeThis method will scroll down the element- Specified by:
scrollDownin interfaceElementFacade
-
scrollToTheRight
public void scrollToTheRight()Description copied from interface:ElementFacadeThis method will scroll the element to the right- Specified by:
scrollToTheRightin interfaceElementFacade
-
scrollToWebElement
public void scrollToWebElement()Description copied from interface:ElementFacadeThis method will scroll up or down until it reaches the web element- Specified by:
scrollToWebElementin interfaceElementFacade
-
waitUntilClickable
public net.serenitybdd.core.pages.WebElementFacade waitUntilClickable()- Specified by:
waitUntilClickablein interfacenet.serenitybdd.core.pages.WebElementFacade- Overrides:
waitUntilClickablein classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
waitUntilNotVisible
public net.serenitybdd.core.pages.WebElementFacade waitUntilNotVisible()- Specified by:
waitUntilNotVisiblein interfacenet.serenitybdd.core.pages.WebElementFacade- Overrides:
waitUntilNotVisiblein classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
waitUntilVisible
public net.serenitybdd.core.pages.WebElementFacade waitUntilVisible()- Specified by:
waitUntilVisiblein interfacenet.serenitybdd.core.pages.WebElementFacade- Overrides:
waitUntilVisiblein classnet.serenitybdd.core.pages.WebElementFacadeImpl
-
checkXpathFormat
Methods for finding element facade inside of this element -
findSubElementFacadeByXPathOrCSS
protected net.serenitybdd.core.pages.WebElementFacade findSubElementFacadeByXPathOrCSS(String xpathOrCss) -
getWebElementFacadeByXPathOrCSS
protected net.serenitybdd.core.pages.WebElementFacade getWebElementFacadeByXPathOrCSS(String xpathOrCss)
-