From 800a7550eb0316e1061444ac0154a3edcf89c2a1 Mon Sep 17 00:00:00 2001 From: GnsP Date: Thu, 17 Oct 2024 10:37:14 +0530 Subject: [PATCH 1/6] empty commit From 2c670a1b52ff9b55903e33143fcbc377c013e55c Mon Sep 17 00:00:00 2001 From: GnsP Date: Thu, 17 Oct 2024 10:54:52 +0530 Subject: [PATCH 2/6] upgrade test framework --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 47e926eb2f4..f50d2c05f8a 100644 --- a/pom.xml +++ b/pom.xml @@ -647,7 +647,7 @@ io.cdap.tests.e2e cdap-e2e-framework - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT test From 6114c36f95e059e08364566a4497a2ba722f9a93 Mon Sep 17 00:00:00 2001 From: GnsP Date: Thu, 24 Oct 2024 11:14:59 +0530 Subject: [PATCH 3/6] try to close the alert only if it's present --- src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java index 690bc011c5e..705579a8c29 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java @@ -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; @@ -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) { From 57d31b79bda497740b65f259abecc020769979f0 Mon Sep 17 00:00:00 2001 From: GnsP Date: Thu, 24 Oct 2024 12:58:28 +0530 Subject: [PATCH 4/6] add explicit timeout --- src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java index 705579a8c29..8303531d338 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java @@ -361,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, 10); ElementHelper.clickOnElement(bannerCloseButton); } catch (NoSuchElementException e) { // pass From c2a0e329b64c74d55487ba795c26b10ed3f82227 Mon Sep 17 00:00:00 2001 From: GnsP Date: Thu, 24 Oct 2024 16:40:52 +0530 Subject: [PATCH 5/6] remove spaces to compare strings irrespective of the formatting added by the editor --- .../java/io/cdap/cdap/ui/stepsdesign/WidgetCodeEditor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/WidgetCodeEditor.java b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/WidgetCodeEditor.java index f50b27c50dc..35b88f594b5 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/WidgetCodeEditor.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/WidgetCodeEditor.java @@ -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") From d7ae04c2128fa0c17f5d985d5a23c7991cb4e412 Mon Sep 17 00:00:00 2001 From: GnsP Date: Tue, 29 Oct 2024 10:16:23 +0530 Subject: [PATCH 6/6] add explicit timeout --- src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java index 8303531d338..2affb74f64e 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/utils/Commands.java @@ -361,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, 10); + WaitHelper.waitForElementToBeClickable(bannerCloseButton, 180L); ElementHelper.clickOnElement(bannerCloseButton); } catch (NoSuchElementException e) { // pass