Skip to content

Commit

Permalink
Merge pull request #1250 from GnsP/upgrade-test-ramework
Browse files Browse the repository at this point in the history
Upgrade test framework to version 0.4.0-SNAPSHOT
  • Loading branch information
GnsP authored Oct 29, 2024
2 parents a3b9bcc + d7ae04c commit 2825ff9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
<dependency>
<groupId>io.cdap.tests.e2e</groupId>
<artifactId>cdap-e2e-framework</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
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
9 changes: 7 additions & 2 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 @@ -356,7 +361,7 @@ public static void dismissTopBanner() {
try {
WebElement bannerCloseButton = Helper.locateElementByXPath(
"//div[@data-testid='valium-banner-hydrator']//button[@class='close ng-scope']");
WaitHelper.waitForElementToBeClickable(bannerCloseButton);
WaitHelper.waitForElementToBeClickable(bannerCloseButton, 180L);
ElementHelper.clickOnElement(bannerCloseButton);
} catch (NoSuchElementException e) {
// pass
Expand Down

0 comments on commit 2825ff9

Please sign in to comment.