diff options
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java')
-rw-r--r-- | ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java | 460 |
1 files changed, 237 insertions, 223 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java index 52dd381216..96db11c0db 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -47,230 +47,244 @@ import java.util.Map; import static org.testng.Assert.assertTrue; public class DeploymentViewTests extends SetupCDTest { - - private String filePath; - - @BeforeMethod - public void beforeTest(){ - filePath = FileHandling.getFilePath(""); - } - - @DataProvider(name = "CSAR_VF_Files", parallel = false) + + private static final int EXPECTED_NUMBER_OF_GROUPS = 3; + private String filePath; + + @BeforeMethod + public void beforeTest() { + filePath = FileHandling.getFilePath(""); + } + + @DataProvider(name = "CSAR_VF_Files", parallel = false) public Object[][] createDataX() { - return new Object[][] {{"vSeGWNew.csar"}, {"vSeGWNewDoubleMembers.csar"}, {"vSeGWNewSingleModule.csar"}}; + return new Object[][]{{"vSeGWNew.csar"}, {"vSeGWNewDoubleMembers.csar"}, {"vSeGWNewSingleModule.csar"}}; } - - - @Test(dataProvider = "CSAR_VF_Files") - public void deploymentScreenDCAEAssetImportCSARTest(String baseFileName) throws Exception{ - // - setLog(baseFileName); + + + @Test(dataProvider = "CSAR_VF_Files") + public void deploymentScreenDCAEAssetImportCSARTest(String baseFileName) throws Exception { + // + setLog(baseFileName); // getExtendTest().setDescription(baseFileName); - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen(); - List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue()); - DeploymentViewVerificator verificator = new DeploymentViewVerificator(filePath + baseFileName); - verificator.verifyDeploymentPageModules(moduleRowsFromTable); - for(WebElement moduleRow : moduleRowsFromTable){ - String moduleRowText = moduleRow.getText(); - verificator.verifyDeploymentPageSubElements(moduleRowText.split("\\.\\.")[1]); - DeploymentPage.updateModuleName(moduleRowText, "updatedName"); - String updatedModuleName = DeploymentPage.reconstructModuleName(moduleRowText.split("\\.\\."), "updatedName"); - verificator.verifyComponentNameChanged( moduleRowText, updatedModuleName); - // Close module - GeneralUIUtils.clickOnElementByText(updatedModuleName); - } - } - - @Test - public void deploymentScreenDCAEAssetUpdateWithNewGroupCSAR_TC1368223_Test() throws Exception{ - String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; - String updateFileName = "baseUpdateFlowVF_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - metaDataFromUI.put("base_ldsa", new HashMap<String, String> (){ {put("version", "0"); - put("moduleID", "primary");}}); - - // add new group, base_ldsa - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetDeleteGroupFromCSAR_TC1368281_Test() throws Exception{ - String baseFileName = "baseUpdateFlowVF_NEW.csar"; - String updateFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 3)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - - // remove group base_ldsa - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be removed", 2)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - // validate that group was removed - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); - - Map<String, HashMap<String, String>> metaDataFromUI2 = DeploymentPage.collectMetaDataFromUI(); - metaDataFromUI2.put("base_ldsa", new HashMap<String, String> (){ {put("version", "0"); - put("moduleID", "primary");}}); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - // add group base_ldsa - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be added", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, baseFileName); - - // validate that group was added - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI2, new DeploymentViewVerificator(filePath + baseFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - } - - @Test - public void deploymentScreenDCAEAssetUpdateWithNewGroupWithoutMembersCSAR_TC1368280_Test() throws Exception{ - - String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; - String updateFileName = "baseUpdateAddGroupNoMembersUpdateFlow_NEW.csar"; - String updateFileName2 = "baseUpdateFlowVF_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - // add new group without members, base_ldsa - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group without members", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - - // validate that group was added and no members exist - DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + updateFileName)); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - // add group base_ldsa with members - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group with members", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName2); - - // validate that member was added to base_ldsa group - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName2)); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetImportCSARWithArtifactSection_TC1368282_1_Test() throws Exception{ - String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", 3)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + baseFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetImportCSARRemoveArtifact_TC1368282_2_Test() throws Exception{ - String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; - String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", 3)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - // remove artifact from every group - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 3 artifacts in every group")); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetImportCSARAddArtifact_TC1368282_3_Test() throws Exception{ - String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; - String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 3 artifacts in every group ", 3)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, updateFileName, getUser()); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - // add artifact to every group - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 4 artifacts in every group")); - ResourceUIUtils.updateVfWithCsar(filePath, baseFileName); - - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + baseFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetImportCSARMixArtifacts_TC1368282_4_Test() throws Exception{ - String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; - String updateFileName = "baseUpdateMixedArtifacts_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", 3)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - //mix artifacts between groups - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, mixing between artifacts and groups", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator()); - DeploymentViewVerificator.validateModuleNameUpadate(); - }; - - @Test - public void deploymentScreenDCAEAssetUpdateVFModule_TC1296437_Test() throws Exception{ - String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; - String updateFileName = "baseUpdateFlowVF_NEW.csar"; - - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen(); + List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue()); + DeploymentViewVerificator verificator = new DeploymentViewVerificator(filePath + baseFileName); + verificator.verifyDeploymentPageModules(moduleRowsFromTable); + for (WebElement moduleRow : moduleRowsFromTable) { + String moduleRowText = moduleRow.getText(); + verificator.verifyDeploymentPageSubElements(moduleRowText.split("\\.\\.")[1]); + DeploymentPage.updateModuleName(moduleRowText, "updatedName"); + String updatedModuleName = DeploymentPage.reconstructModuleName(moduleRowText.split("\\.\\."), "updatedName"); + verificator.verifyComponentNameChanged(moduleRowText, updatedModuleName); + // Close module + GeneralUIUtils.clickOnElementByText(updatedModuleName); + } + } + + @Test + public void deploymentScreenDCAEAssetUpdateWithNewGroupCSAR_TC1368223_Test() throws Exception { + String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; + String updateFileName = "baseUpdateFlowVF_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + metaDataFromUI.put("base_ldsa", new HashMap<String, String>() { + { + put("version", "0"); + put("moduleID", "primary"); + } + }); + + // add new group, base_ldsa + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetDeleteGroupFromCSAR_TC1368281_Test() throws Exception { + String baseFileName = "baseUpdateFlowVF_NEW.csar"; + String updateFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + + // remove group base_ldsa + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be removed", 2)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + // validate that group was removed + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); + + Map<String, HashMap<String, String>> metaDataFromUI2 = DeploymentPage.collectMetaDataFromUI(); + metaDataFromUI2.put("base_ldsa", new HashMap<String, String>() { + { + put("version", "0"); + put("moduleID", "primary"); + } + }); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + // add group base_ldsa + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be added", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, baseFileName); + + // validate that group was added + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI2, new DeploymentViewVerificator(filePath + baseFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetUpdateWithNewGroupWithoutMembersCSAR_TC1368280_Test() throws Exception { + + String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; + String updateFileName = "baseUpdateAddGroupNoMembersUpdateFlow_NEW.csar"; + String updateFileName2 = "baseUpdateFlowVF_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + // add new group without members, base_ldsa + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group without members", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + + // validate that group was added and no members exist + DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + updateFileName)); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + // add group base_ldsa with members + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group with members", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName2); + + // validate that member was added to base_ldsa group + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName2)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + + @Test + public void deploymentScreenDCAEAssetImportCSARWithArtifactSection_TC1368282_1_Test() throws Exception { + String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + baseFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetImportCSARRemoveArtifact_TC1368282_2_Test() throws Exception { + String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; + String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + // remove artifact from every group + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 3 artifacts in every group")); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetImportCSARAddArtifact_TC1368282_3_Test() throws Exception { + String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; + String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 3 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, updateFileName, getUser()); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + // add artifact to every group + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 4 artifacts in every group")); + ResourceUIUtils.updateVfWithCsar(filePath, baseFileName); + + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + baseFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetImportCSARMixArtifacts_TC1368282_4_Test() throws Exception { + String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar"; + String updateFileName = "baseUpdateMixedArtifacts_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + //mix artifacts between groups + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, mixing between artifacts and groups", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator()); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + @Test + public void deploymentScreenDCAEAssetUpdateVFModule_TC1296437_Test() throws Exception { + String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar"; + String updateFileName = "baseUpdateFlowVF_NEW.csar"; + + ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2)); + ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser()); // SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating %s group version, should be %s ", moduleRowText, metaDataFromUI.get(moduleRowText.split("\\.\\.")[1]))); - - Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); - metaDataFromUI.put("base_ldsa", new HashMap<String, String> (){ {put("version", "0"); - put("moduleID", "primary");}}); - - DeploymentViewVerificator.validateEditPopover(); - - ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); - SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", 3)); - ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); - - assertTrue(resourceMetaData.getName().equals(ResourceGeneralPage.getNameText())); - DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); - DeploymentViewVerificator.validateModuleNameUpadate(); - } - - - @Override - protected UserRoleEnum getRole() { - return UserRoleEnum.DESIGNER; - } + + Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI(); + metaDataFromUI.put("base_ldsa", new HashMap<String, String>() { + { + put("version", "0"); + put("moduleID", "primary"); + } + }); + + DeploymentViewVerificator.validateEditPopover(); + + ResourceGeneralPage.getLeftMenu().moveToGeneralScreen(); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", EXPECTED_NUMBER_OF_GROUPS)); + ResourceUIUtils.updateVfWithCsar(filePath, updateFileName); + + assertTrue(resourceMetaData.getName().equals(ResourceGeneralPage.getNameText())); + DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName)); + DeploymentViewVerificator.validateModuleNameUpadate(); + } + + + @Override + protected UserRoleEnum getRole() { + return UserRoleEnum.DESIGNER; + } } |