bug5239: pulled method clickOkButtonOrThrow() up to DataEntryDialogPO

This commit is contained in:
Dennis Aulenbacher committed 2020-08-11 17:50:55 +02:00
1 parent f17a6fede8
commit fcc5c7e6bd
2 files changed
+9 -10

No files matched your search

@@ -1,6 +1,5 @@
package com.sap.sailing.selenium.pages.adminconsole.usermanagement;
import org.openqa.selenium.ElementNotSelectableException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
@@ -28,13 +27,4 @@ public class ChangePasswordDialogPO extends DataEntryDialogPO {
PasswordTextBoxPO.create(driver, textBoxPw).appendText(newPassword);
PasswordTextBoxPO.create(driver, textBoxPwRepeat).appendText(newPassword);
}
public void clickOkButtonOrThrow() {
if (!okButton.isEnabled()) {
throw new ElementNotSelectableException("OK Button was disabled");
} else {
okButton.click();
}
}
}
@@ -3,6 +3,7 @@ package com.sap.sailing.selenium.pages.common;
import java.util.function.BooleanSupplier;
import org.openqa.selenium.Alert;
import org.openqa.selenium.ElementNotSelectableException;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
@@ -109,4 +110,12 @@ public abstract class DataEntryDialogPO extends PageArea {
public boolean isMakeDefaultButtonVisible() {
return !driver.findElements(new BySeleniumId(ID_MAKE_DEFAULT_BUTTON)).isEmpty();
}
public void clickOkButtonOrThrow() {
if (!okButton.isEnabled()) {
throw new ElementNotSelectableException("OK Button was disabled");
} else {
okButton.click();
}
}
}