2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.execute.sanity;
23 import org.openecomp.sdc.be.dao.api.ActionStatus;
24 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
25 import org.openecomp.sdc.be.model.User;
26 import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
27 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
28 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.Dashboard;
29 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
30 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
31 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
32 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
33 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
34 import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
35 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
36 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
37 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
38 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
39 import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
40 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
41 import org.openqa.selenium.WebElement;
42 import org.testng.annotations.Test;
44 import java.util.ArrayList;
45 import java.util.List;
47 import static org.assertj.core.api.Assertions.assertThat;
50 public class VfDeploymentInformationalArtifacts extends SetupCDTest {
53 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
57 // US824719 - Import VSP - VF informational artifacts
58 // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
60 public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
61 String fileName = "TC1434241.csar";
62 String folder = "US825779";
64 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
65 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
66 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
67 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
69 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
72 // US824719 - Import VSP - VF informational artifacts
73 // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
75 public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
76 String fileName = "TC1434245.csar";
77 String folder = "US825779";
79 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
80 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
81 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
83 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
84 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
85 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
87 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
88 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
90 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
93 // US824719 - Import VSP - VF informational artifacts
94 // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
96 public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
97 String fileName = "TC1434247.csar";
98 String folder = "US825779";
100 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
101 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
102 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
104 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
105 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
107 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
110 // US824719 - Import VSP - VF informational artifacts
111 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
113 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
114 String fileName = "TC1434248.csar";
115 String folder = "US825779";
117 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
118 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
119 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
121 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
122 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
123 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
124 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
126 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
129 // US824719 - Import VSP - VF informational artifacts
130 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
132 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
133 String fileName = "TC1434249.csar";
134 String folder = "US825779";
136 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
137 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
138 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
139 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
140 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
141 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
142 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
143 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
145 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
146 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
147 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
148 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
150 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
153 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
154 // TODO: re-check it after defect fix
155 // US824719 - Import VSP - VF informational artifacts
156 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
158 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
159 String fileName = "DeploymentArtifactWithInvalidType.csar";
160 String folder = "US825779";
162 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
163 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
164 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
165 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
167 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
170 // US824719 - Import VSP - VF informational artifacts
171 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
173 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
174 String fileName = "InformationArtifactWithInvalidType.csar";
175 String folder = "US825779";
177 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
178 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
179 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
181 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
182 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
184 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
187 // US824719 - Import VSP - VF informational artifacts
188 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
190 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
191 String folder = "US825779";
192 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
194 String fileName = "DeploymentArtifactWithLongName.csar";
196 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
198 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
199 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
200 assertThat(errorMessage).contains(checkUIResponseOnError);
203 // US824719 - Import VSP - VF informational artifacts
204 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
205 // TODO: make informational artifact name longer then 255
206 // TODO: windows/linux not allowed it
207 @Test(enabled = true)
208 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
209 String folder = "US825779";
210 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
212 String fileName = "InformationArtifactWithLongName.csar";
214 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
216 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
217 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
218 assertThat(errorMessage).contains(checkUIResponseOnError);
221 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
223 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
226 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
228 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
230 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
231 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
233 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
234 String folder = "US825779";
235 String fileName = "ImportTC1443954.csar";
237 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
238 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
239 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
241 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
242 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
244 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
245 deploymentArtifacts.add(deploymentHeat1);
246 deploymentArtifacts.add(deploymentHeat2);
247 deploymentArtifacts.add(deploymentHeat3);
248 deploymentArtifacts.add(deploymentHeatVol1);
249 deploymentArtifacts.add(deploymentHeatVol2);
251 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
252 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
254 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
255 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
256 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
258 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
259 informationalArtifacts.add(infoGuide1);
260 informationalArtifacts.add(infoGuide2);
261 informationalArtifacts.add(infoOther1);
262 informationalArtifacts.add(infoOther2);
263 informationalArtifacts.add(infoOther3);
265 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
267 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
269 fileName = "UpdateTC1443954.csar";
271 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
272 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
274 // Changes in deployment artifacts
275 deploymentArtifactsNotExist.add(deploymentHeat1);
276 deploymentArtifactsNotExist.add(deploymentHeat2);
277 deploymentArtifacts.remove(deploymentHeat1);
278 deploymentArtifacts.remove(deploymentHeat2);
279 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
280 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
281 deploymentHeatVol1.setArtifactVersion("2");
282 deploymentHeatVol2.setArtifactVersion("2");
284 // Changes in informational artifacts
285 infoGuide1.setArtifactVersion("2");
286 infoOther1.setArtifactVersion("2");
287 informationalArtifactsNotExist.add(infoGuide2);
288 informationalArtifactsNotExist.add(infoOther2);
289 informationalArtifacts.remove(infoGuide2);
290 informationalArtifacts.remove(infoOther2);
291 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
292 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
294 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
298 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
299 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
301 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
302 String folder = "US825779";
303 String fileName = "ImportTC1444206.csar";
304 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
305 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
306 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
307 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
309 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
311 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
313 fileName = "UpdateTC1444206.csar";
314 String filePath = FileHandling.getFilePath(folder);
316 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
318 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
319 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
320 assertThat(errorMessage).contains(checkUIResponseOnError);
323 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
324 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
326 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
327 String folder = "US825779";
328 String fileName = "ImportTC1444207.csar";
330 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
331 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
332 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
334 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
335 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
337 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
339 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
341 fileName = "UpdateTC1444207.csar";
342 String filePath = FileHandling.getFilePath(folder);
344 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
346 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
347 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
348 assertThat(errorMessage).contains(checkUIResponseOnError);
352 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
353 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
355 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
356 String folder = "US825779";
357 String fileName = "ImportTC1444208.csar";
359 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
360 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
361 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
362 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
364 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
366 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
368 fileName = "UpdateTC1444208.csar";
369 String filePath = FileHandling.getFilePath(folder);
371 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
373 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
374 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
375 assertThat(errorMessage).contains(checkUIResponseOnError);
378 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
379 // TC1444520 - Update Deployment Artifact With Name To Long
381 public void updateDeploymentArtifactWithNameToLong() throws Exception {
382 String folder = "US825779";
384 String fileName = "ImportTC1444520.csar";
386 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
388 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
390 fileName = "UpdateTC1444520.csar";
391 String filePath = FileHandling.getFilePath(folder);
393 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
395 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
396 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
397 assertThat(errorMessage).contains(checkUIResponseOnError);
400 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
401 // TC1444521 - Update Informational Artifact With Name To Long
403 public void updateInformationalArtifactWithNameToLong() throws Exception {
405 String folder = "US825779";
406 String fileName = "ImportTC1444521.csar";
408 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
410 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
412 fileName = "UpdateTC1444521.csar";
413 String filePath = FileHandling.getFilePath(folder);
415 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
417 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
418 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
419 assertThat(errorMessage).contains(checkUIResponseOnError);
422 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
423 // TC1444531 - Update Informational Artifact With Invalid Type
425 public void updateInformationalArtifactWithInvalidType() throws Exception {
426 String folder = "US825779";
427 String fileName = "ImportTC1444531.csar";
429 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
431 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
433 fileName = "UpdateTC1444531.csar";
435 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
436 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
438 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
443 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception {
444 String fileName = "ValidArtifactNameInInvalidFolder.csar";
445 String folder = "US824719";
447 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
448 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
449 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
451 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
455 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception {
456 String fileName = "ImportTC1444533.csar";
457 String folder = "US824719";
458 String filePath = FileHandling.getFilePath(folder);
460 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
461 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
463 String updatedCsarFileName = "UpdateTC1444533.csar";
465 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
466 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
467 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
469 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
473 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
475 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
478 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
479 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
480 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
481 String filePath = FileHandling.getFilePath(folder);
482 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
484 validateDeploymentArtifactPage(deploymentArtifacts, null);
485 validateInformationalArtifactPage(informationalArtifacts, null);
487 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
489 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
490 validateInformationalArtifactInComposition(informationalArtifacts, null);
495 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
496 String filePath = FileHandling.getFilePath(folder);
497 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
498 // Insert file to the browse dialog
499 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
500 browseWebElement.sendKeys(filePath + fileName);
502 // Fill the general page fields.
503 GeneralUIUtils.waitForLoader();
504 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
505 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
509 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
510 String filePath = FileHandling.getFilePath(folder);
511 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
512 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
514 validateDeploymentArtifactPage(deploymentArtifacts, null);
515 validateInformationalArtifactPage(informationalArtifacts, null);
517 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
519 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
520 validateInformationalArtifactInComposition(informationalArtifacts, null);
523 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
524 CompositionPage.showInformationArtifactTab();
525 // Composition informational
526 if (informationalArtifacts != null && informationalArtifacts.size() > 0) {
527 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
529 if (informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
530 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
534 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
535 CompositionPage.showDeploymentArtifactTab();
536 // Composition deployment
537 if (deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
538 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
540 if (deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
541 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
545 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
546 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
547 // Informational page
548 if (informationalArtifacts != null && informationalArtifacts.size() > 0) {
549 validateEachArtifactInformationPage(informationalArtifacts);
551 if (informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
552 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
556 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
557 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
559 if (deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
560 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
562 if (deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
563 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
567 // TODO: add validation that if not editable / deleteable then button should not appear
568 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
569 for (ArtifactInfo artifact : artifactInfoList) {
570 String type = artifact.getArtifactType();
571 String label = artifact.getArtifactLabel();
572 String version = artifact.getArtifactVersion();
574 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())) {
575 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
577 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
582 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
583 for (ArtifactInfo artifact : artifactInfoList) {
584 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
588 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
589 for (ArtifactInfo artifact : artifactInfoList) {
590 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
594 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
595 for (ArtifactInfo artifact : artifactInfoList) {
596 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
600 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
601 for (ArtifactInfo artifact : artifactInfoList) {
603 String type = artifact.getArtifactType();
604 String label = artifact.getArtifactLabel();
605 String filename = artifact.getFilename();
607 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())) {
608 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
610 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
615 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
616 for (ArtifactInfo artifact : artifactInfoList) {
617 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
621 // TODO: there is defect in this flow
622 // TODO: change isEditable to false when defect fix
623 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
624 for (ArtifactInfo artifact : artifactInfoList) {
625 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
629 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
630 for (ArtifactInfo artifact : artifactInfoList) {
631 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
637 protected UserRoleEnum getRole() {
638 return UserRoleEnum.DESIGNER;