Skip to content

Commit

Permalink
try to close the alert only if it's present
Browse files Browse the repository at this point in the history
  • Loading branch information
GnsP committed Oct 24, 2024
1 parent 2c670a1 commit 6114c36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.StaleElementReferenceException;
Expand Down Expand Up @@ -183,7 +184,11 @@ public static void fillConnectionCreateForm(String connectionType, String connec
}

public static void dismissStudioLeaveConfirmationModal() {
SeleniumDriver.getDriver().switchTo().alert().accept();
try {
SeleniumDriver.getDriver().switchTo().alert().accept();
} catch (NoAlertPresentException e) {
// ignore it.
}
}

public static void openPluginGroupPanel(String pluginGroup) {
Expand Down

0 comments on commit 6114c36

Please sign in to comment.