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

[🍒][6.10] cherrypick part of #1250 #1262

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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 @@ -65,8 +65,8 @@ public void verifyDefaultJSEditorValue() {
WebElement jsEditorContentElement = jsEditorElement.findElement(
By.cssSelector("div[class*='ace_text-layer']"));
String editorValue = ElementHelper.getElementText(jsEditorContentElement);
Assert.assertEquals(StringUtils.normalizeSpace(editorValue),
StringUtils.normalizeSpace(defaultJsEditorVal));
Assert.assertEquals(defaultJsEditorVal.replaceAll("\\s+", ""),
editorValue.replaceAll("\\s+", ""));
}

@Then("Replace and verify JS editor value and cursor position")
Expand Down
13 changes: 10 additions & 3 deletions 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 Expand Up @@ -354,8 +359,10 @@ public static void fillInPipelineName(String pipelineName) {

public static void dismissTopBanner() {
try {
ElementHelper.clickOnElement(Helper.locateElementByXPath(
"//div[@data-testid='valium-banner-hydrator']//button[@class='close ng-scope']"));
WebElement bannerCloseButton = Helper.locateElementByXPath(
"//div[@data-testid='valium-banner-hydrator']//button[@class='close ng-scope']");
WaitHelper.waitForElementToBeClickable(bannerCloseButton, 180L);
ElementHelper.clickOnElement(bannerCloseButton);
} catch (NoSuchElementException e) {
// pass
}
Expand Down
Loading