mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 22:15:26 +00:00
bug5239: pulled method clickOkButtonOrThrow() up to DataEntryDialogPO
This commit is contained in:
1 parent
f17a6fede8
commit
fcc5c7e6bd
2 files changed
+9
-10
No files matched your search
-10
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user