diff options
author | 2019-04-24 12:05:09 +0530 | |
---|---|---|
committer | 2019-05-12 11:01:37 +0000 | |
commit | 8364c2d4c986e37cc1ea7e4120f5d13d14b03067 (patch) | |
tree | d82c537f4629ac6da37247fc6282cda37e388e99 /ui-ci/src/main/java/org | |
parent | c9ea96bba4907a905e68635aeeea73a69de2cfee (diff) |
Functional Test Automation: VSP
Change-Id: Ifd417c2ecfe1e82a69f64b3908c768fbd3b0af4f
Issue-ID: SDC-2047
Co-authored-by: rahul.ghugikar@vodafone.com, soumyarup.paul@vodafone.com
Signed-off-by: Vodafone <onap@vodafone.com>
Diffstat (limited to 'ui-ci/src/main/java/org')
-rw-r--r-- | ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java | 63 | ||||
-rw-r--r-- | ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java | 14 |
2 files changed, 74 insertions, 3 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java index 6a02a917f8..3461aa8af5 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java @@ -194,6 +194,7 @@ public class OnboardingFlowsUI extends SetupCDTest { public void onapOnboardVSPComplianceCheckFlow(String filePath, String vnfFile) throws Exception, Throwable { setLog(vnfFile); String vspName = createNewVSP(filePath, vnfFile); + final String complianceNotAvailableLabel = "No Compliance Checks are Available"; if(!OnboardingUiUtils.getVspValidationCongiguration()){ //change config to true to test the feature changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration()); @@ -211,10 +212,68 @@ public class OnboardingFlowsUI extends SetupCDTest { VspValidationPage.clickOnNextButton(); GeneralUIUtils.ultimateWait(); VspValidationPage.clickOnSubmitButton(); - GeneralUIUtils.waitForLoader(); + GeneralUIUtils.ultimateWait(); assertTrue("Results are not available", VspValidationResultsPage.checkResultsExist()); } else { + assertNotNull(GeneralUIUtils.findByText(complianceNotAvailableLabel)); + } + + } + + @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF") + public void onapOnboardVSPComplianceCheckOperations(String filePath, String vnfFile) throws Exception { + setLog(vnfFile); + String vspName = createNewVSP(filePath, vnfFile); + if(!OnboardingUiUtils.getVspValidationCongiguration()){ + //change config to true to test the feature + changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration()); + } + else { + goToVspScreen(true, vspName); + } + + VspValidationPage.navigateToVspValidationPageUsingNavbar(); + assertTrue("Next Button is enabled, it should have been enabled", VspValidationPage.checkNextButtonDisabled()); + if(VspValidationPage.checkComplianceCheckExists()){ + assertTrue("The tests are already selected, the list should initially be empty", !VspValidationPage.checkSelectedComplianceCheckExists()); + VspValidationPage.clickComplianceChecksAll(); + GeneralUIUtils.ultimateWait(); + assertTrue("The selected tests are not populated in the list", VspValidationPage.checkSelectedComplianceCheckExists()); + VspValidationPage.clickComplianceChecksAll(); + GeneralUIUtils.ultimateWait(); + assertTrue("The selected tests are not deleted from the list", !VspValidationPage.checkSelectedComplianceCheckExists()); + } + else { + assertNotNull(GeneralUIUtils.findByText("No Compliance Checks are Available")); + } + + } + + @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders.class, dataProvider = "Single_VNF") + public void onapOnboardVSPCertificationQueryOperations(String filePath, String vnfFile) throws Exception { + setLog(vnfFile); + String vspName = createNewVSP(filePath, vnfFile); + if(!OnboardingUiUtils.getVspValidationCongiguration()){ + //change config to true to test the feature + changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration()); + } + else { + goToVspScreen(true, vspName); + } + + VspValidationPage.navigateToVspValidationPageUsingNavbar(); + assertTrue("Next Button is enabled, it should have been enabled", VspValidationPage.checkNextButtonDisabled()); + if(VspValidationPage.checkCertificationQueryExists()){ + assertTrue("The tests are already selected, the list should initially be empty", !VspValidationPage.checkSelectedCertificationQueryExists()); + VspValidationPage.clickCertificationQueryAll(); + GeneralUIUtils.ultimateWait(); + assertTrue("The selected tests are not populated in the list", VspValidationPage.checkSelectedCertificationQueryExists()); + VspValidationPage.clickCertificationQueryAll(); + GeneralUIUtils.ultimateWait(); + assertTrue("The selected tests are not deleted from the list", !VspValidationPage.checkSelectedCertificationQueryExists()); + } + else { assertNotNull(GeneralUIUtils.findByText("No Compliance Checks are Available")); } @@ -253,7 +312,7 @@ public class OnboardingFlowsUI extends SetupCDTest { if(isCurrentScreenCatalogPage) GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue()); GeneralUIUtils.clickOnElementByText(vspName); - GeneralUIUtils.waitForLoader(); + GeneralUIUtils.ultimateWait(); } private String createNewVSP(String filePath, String vnfFile) throws Exception { diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java index 286ee46482..739f172d37 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java @@ -86,13 +86,25 @@ public class VspValidationPage extends GeneralPageElements { return (orderedList.size() > 0);
}
+ public static boolean checkSelectedComplianceCheckExists() throws Exception {
+ WebElement selectedTests = GeneralUIUtils.findElementsByXpath("//div[contains(text(),'Selected Compliance Tests')]/..//select[@class='validation-setup-selected-tests']").get(0);
+ List<WebElement> options = getChildElements(selectedTests);
+ return (!options.isEmpty());
+ }
+
+ public static boolean checkSelectedCertificationQueryExists() throws Exception {
+ WebElement selectedTests = GeneralUIUtils.findElementsByXpath("//div[contains(text(),'Selected Certifications Query')]/..//select[@class='validation-setup-selected-tests']").get(0);
+ List<WebElement> options = getChildElements(selectedTests);
+ return (!options.isEmpty());
+ }
+
public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage elementTestId) throws Exception {
SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
GeneralUIUtils.ultimateWait();
}
- public static List<WebElement> getChildElements(WebElement webElement) throws Exception {
+ private static List<WebElement> getChildElements(WebElement webElement) throws Exception {
return webElement.findElements(By.xpath(".//*"));
}
|