mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
Waiting for alert when adding Igtimi account
This commit is contained in:
1 parent
9e1216affc
commit
5ddf50d46f
1 file changed
+19
-1
+19
-1
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.igtimi;
|
||||
|
||||
import org.openqa.selenium.Alert;
|
||||
import org.openqa.selenium.NoAlertPresentException;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
@@ -35,10 +37,26 @@ public class IgtimiAccountsManagementPanelPO extends PageArea {
|
||||
return getPO(AddIgtimiAccountDialogPO::new, "AddIgtimiAccountDialog");
|
||||
}
|
||||
|
||||
public void addAccount(String email, String password) {
|
||||
public void addAccount(String email, String password) throws InterruptedException {
|
||||
AddIgtimiAccountDialogPO addIgtimiAccountDialog = openAddIgtimiAccountDialog();
|
||||
addIgtimiAccountDialog.setEmail(email);
|
||||
addIgtimiAccountDialog.setPassword(password);
|
||||
addIgtimiAccountDialog.pressOk();
|
||||
|
||||
int i = 0;
|
||||
while (i < DEFAULT_WAIT_TIMEOUT_SECONDS) {
|
||||
i++;
|
||||
try {
|
||||
Alert alert = driver.switchTo().alert();
|
||||
alert.accept();
|
||||
break;
|
||||
} catch (NoAlertPresentException e) {
|
||||
Thread.sleep(1000);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (i >= DEFAULT_WAIT_TIMEOUT_SECONDS) {
|
||||
throw new NoAlertPresentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user