From a64494f7e900680c08f1e4f6451a15debeb08853 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Mon, 15 Mar 2021 16:51:12 +0000 Subject: [PATCH] Update integration UI tests selenium image The integration UI tests were using a very old selenium image "selenium/standalone-firefox:2.53.1" (from 4 years ago), which was bringing problems related with outdated version of firefox/selenium standalone. Fixes broken tests after the update. Updates also the gecko driver to the 0.29.0 version. Change-Id: I1f7ad17c649e4015cde5c1932f9da08e36ca0aec Issue-ID: SDC-3516 Signed-off-by: andre.schmid --- .../modals/onboarding-modal/onboarding-modal.component.ts | 3 ++- integration-tests/pom.xml | 8 +++----- .../sdc/frontend/ci/tests/execute/setup/WebDriverThread.java | 4 +++- .../sdc/frontend/ci/tests/pages/GeneralPageElements.java | 4 +--- .../java/org/onap/sdc/frontend/ci/tests/pages/HomePage.java | 6 ++++++ .../sdc/frontend/ci/tests/utilities/OnboardingUiUtils.java | 2 +- .../onap/sdc/frontend/ci/tests/utilities/ServiceUIUtils.java | 12 ++++++------ 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts index 2e41716e0b..10d7f67860 100644 --- a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts +++ b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts @@ -135,7 +135,8 @@ export class OnboardingModalComponent implements OnInit { (file: any): void => { this.isLoading = false; if (file.body) { - this.fileUtilsService.downloadFile(file.body, packageId + '.csar'); + this.fileUtilsService.downloadFile(new Blob([file.body], + {type: 'application/octet-stream'}), packageId + '.csar'); } }, (): void => { this.isLoading = false; diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 80eef5bd15..b025da202e 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -37,7 +37,7 @@ limitations under the License. 3.141.59 - 0.27.0 + 0.29.0 integration-test 9042 @@ -50,7 +50,7 @@ limitations under the License. ${project.build.directory}/plugins/sdc-be /tmp/sdc-integration-tests latest - 2.53.1 + 86.0 1.6.5 @@ -216,7 +216,7 @@ limitations under the License. org.seleniumhq.selenium selenium-server - 4.0.0-alpha-2 + ${selenium.version} test @@ -740,12 +740,10 @@ limitations under the License. - - -debug -Xmx512m 1920 diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java index 4d08e846e8..a24c21dab8 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java @@ -104,7 +104,9 @@ public class WebDriverThread { //firefoxProfile.setPreference("browser.download.dir", config.getContainerDownloadAutomationFolder()); //firefoxProfile.setPreference("app.update.notifyDuringDownload", false); //firefoxProfile.setPreference("browser.download.lastDir", config.getContainerDownloadAutomationFolder()); - firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream, application/xml, text/plain, text/xml, image/jpeg"); + final String contentType = "application/zip, application/octet-stream, application/xml, text/plain, text/xml, image/jpeg"; + firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", contentType); + firefoxProfile.setPreference("browser.helperApps.neverAsk.openFile", contentType); firefoxProfile.setPreference("network.proxy.type", 4); firefoxProfile.setAcceptUntrustedCertificates(true); firefoxProfile.setAssumeUntrustedCertificateIssuer(true); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/GeneralPageElements.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/GeneralPageElements.java index 2397815c98..64c87ce945 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/GeneralPageElements.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/GeneralPageElements.java @@ -141,7 +141,6 @@ public class GeneralPageElements { SetupCDTest.getExtendTest().log(Status.INFO, String.format("Component %s archived successfully", componentName)); } - //TODO should implement real code public static void clickCertifyButton(String componentName) throws Exception { try { SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on certify button"); @@ -150,8 +149,7 @@ public class GeneralPageElements { .sendKeys("resource " + componentName + " certified successfully"); clickOKButton(); GeneralUIUtils.ultimateWait(); - HomePage.navigateToHomePage(); - GeneralUIUtils.ultimateWait(); + GeneralUIUtils.waitForElementInVisibilityBy(By.className("notification-container"), 10000); HomePage.navigateToHomePage(); GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue(), GeneralUIUtils.getTimeOut() / WAIT_FOR_ELEMENT_TIME_OUT_DIVIDER); GeneralUIUtils.ultimateWait(); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/HomePage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/HomePage.java index 4f270cf751..0c72a9752c 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/HomePage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/HomePage.java @@ -29,6 +29,7 @@ import org.onap.sdc.frontend.ci.tests.utilities.FileHandling; import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.slf4j.Logger; @@ -41,6 +42,7 @@ import java.util.Calendar; import java.util.List; import java.util.UUID; +import static org.onap.sdc.frontend.ci.tests.execute.setup.DriverFactory.getDriver; import static org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest.getExtendTest; import static org.onap.sdc.frontend.ci.tests.pages.HomePage.PageElement.REPOSITORY_ICON; @@ -103,6 +105,10 @@ public class HomePage { GeneralUIUtils.closeErrorMessage(); WebElement homeButton = GeneralUIUtils .getInputElement(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue()); + if (homeButton != null) { + //making sure that the mouse it is not on the add/import area + new Actions(getDriver()).moveToElement(homeButton).perform(); + } return homeButton != null && homeButton.isDisplayed(); } catch (final Exception e) { diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/OnboardingUiUtils.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/OnboardingUiUtils.java index b415192697..84a528e98c 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/OnboardingUiUtils.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/OnboardingUiUtils.java @@ -165,7 +165,7 @@ public class OnboardingUiUtils { DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId()); File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); - + ExtentTestActions.log(Status.INFO, String.format("Downloaded CSAR file '%s'", latestFilefromDir)); ExtentTestActions.log(Status.INFO, String.format("Going to import %s", vnfFile.substring(0, vnfFile.indexOf(".")))); importVSP(createVendorSoftwareProduct); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/ServiceUIUtils.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/ServiceUIUtils.java index 48fb0b8efb..1293401ca2 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/ServiceUIUtils.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/ServiceUIUtils.java @@ -21,20 +21,19 @@ package org.onap.sdc.frontend.ci.tests.utilities; import com.aventstack.extentreports.Status; +import java.util.ArrayList; +import java.util.List; import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails; import org.onap.sdc.backend.ci.tests.datatypes.enums.ServiceCategoriesEnum; +import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum; +import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest; import org.onap.sdc.frontend.ci.tests.pages.GeneralPageElements; import org.onap.sdc.frontend.ci.tests.pages.ServiceGeneralPage; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; -import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum; -import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest; +import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import java.util.ArrayList; -import java.util.List; public class ServiceUIUtils { @@ -61,6 +60,7 @@ public class ServiceUIUtils { ServiceGeneralPage.defineNamingPolicy(service.getNamingPolicy()); defineTagsList2(service.getTags()); ServiceGeneralPage.defineContactId(service.getContactId()); + GeneralUIUtils.waitForElementInVisibilityBy(By.className("notification-container"), 10000); GeneralUIUtils.clickSomewhereOnPage(); } -- 2.16.6