Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify accessibility of methods Basepageobject / pagehelper #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ protected boolean isElementPresent(WebElement element) {
return pageHelper.isElementPresent(element);
}

/**
* Check to see if the element is visible or not.
*
* @param element WebElement to search for
* @return found or not
*/
protected boolean isElementVisible(WebElement element) {
return pageHelper.isElementVisible(element);
}

/**
* Check to see if the element is on the page or not.
*
Expand Down Expand Up @@ -302,6 +312,20 @@ public void waitForElementToClickable(WebElement webElement, int timeOutInSecond
pageHelper.waitForElementToClickable(webElement, timeOutInSeconds);
}

/**
* Wait and click the element.
*
* Ignore {@link WebDriverException}. When a DOM operation is happening on a page it may
* temporarily cause the element to be inaccessible. Ignore these hierarchy of Exceptions.
*
* @param webElement Can click the element.
* @param timeOutInSeconds Timeout in Seconds.
*
*/
public void waitAndClickElement(WebElement webElement, int timeOutInSeconds) {
pageHelper.waitAndClickElement(webElement, timeOutInSeconds);
}

/**
* Find the first visible element in a list.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void waitForElementToClickable(WebElement webElement, int timeOutInSecond
* @param timeOutInSeconds Timeout in Seconds.
*
*/
private void waitAndClickElement(WebElement element, int timeoutSeconds) {
protected void waitAndClickElement(WebElement element, int timeoutSeconds) {

new WebDriverWait(this.pageObject.getBrowser().getDriver(), timeoutSeconds).ignoring(WebDriverException.class)
.until((WebDriver d) -> {
Expand Down