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
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 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
229 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
231 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
233 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
234 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
236 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
237 String folder ="US825779";
238 String fileName = "ImportTC1443954.csar";
240 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
241 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
242 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
244 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
245 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
247 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
248 deploymentArtifacts.add(deploymentHeat1);
249 deploymentArtifacts.add(deploymentHeat2);
250 deploymentArtifacts.add(deploymentHeat3);
251 deploymentArtifacts.add(deploymentHeatVol1);
252 deploymentArtifacts.add(deploymentHeatVol2);
254 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
255 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
257 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
258 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
259 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
261 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
262 informationalArtifacts.add(infoGuide1);
263 informationalArtifacts.add(infoGuide2);
264 informationalArtifacts.add(infoOther1);
265 informationalArtifacts.add(infoOther2);
266 informationalArtifacts.add(infoOther3);
268 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
270 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
272 fileName = "UpdateTC1443954.csar";
274 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
275 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
277 // Changes in deployment artifacts
278 deploymentArtifactsNotExist.add(deploymentHeat1);
279 deploymentArtifactsNotExist.add(deploymentHeat2);
280 deploymentArtifacts.remove(deploymentHeat1);
281 deploymentArtifacts.remove(deploymentHeat2);
282 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
283 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
284 deploymentHeatVol1.setArtifactVersion("2");
285 deploymentHeatVol2.setArtifactVersion("2");
287 // Changes in informational artifacts
288 infoGuide1.setArtifactVersion("2");
289 infoOther1.setArtifactVersion("2");
290 informationalArtifactsNotExist.add(infoGuide2);
291 informationalArtifactsNotExist.add(infoOther2);
292 informationalArtifacts.remove(infoGuide2);
293 informationalArtifacts.remove(infoOther2);
294 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
295 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
297 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
301 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
302 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
304 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
305 String folder ="US825779";
306 String fileName = "ImportTC1444206.csar";
307 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
308 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
309 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
310 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
312 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
314 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
316 fileName = "UpdateTC1444206.csar";
317 String filePath = FileHandling.getFilePath(folder); ;
319 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
321 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
322 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
323 assertThat(errorMessage).contains(checkUIResponseOnError);
326 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
327 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
329 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
330 String folder ="US825779";
331 String fileName = "ImportTC1444207.csar";
333 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
334 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
335 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
337 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
338 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
340 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
342 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
344 fileName = "UpdateTC1444207.csar";
345 String filePath = FileHandling.getFilePath(folder);
347 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
349 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
350 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
351 assertThat(errorMessage).contains(checkUIResponseOnError);
355 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
356 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
358 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
359 String folder ="US825779";
360 String fileName = "ImportTC1444208.csar";
362 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
363 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
364 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
365 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
367 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
369 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
371 fileName = "UpdateTC1444208.csar";
372 String filePath = FileHandling.getFilePath(folder); ;
374 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
376 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
377 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
378 assertThat(errorMessage).contains(checkUIResponseOnError);
381 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
382 // TC1444520 - Update Deployment Artifact With Name To Long
384 public void updateDeploymentArtifactWithNameToLong() throws Exception {
385 String folder ="US825779";
387 String fileName = "ImportTC1444520.csar";
389 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
391 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
393 fileName = "UpdateTC1444520.csar";
394 String filePath = FileHandling.getFilePath(folder); ;
396 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
398 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
399 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
400 assertThat(errorMessage).contains(checkUIResponseOnError);
403 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
404 // TC1444521 - Update Informational Artifact With Name To Long
406 public void updateInformationalArtifactWithNameToLong() throws Exception {
408 String folder = "US825779";
409 String fileName = "ImportTC1444521.csar";
411 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
413 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
415 fileName = "UpdateTC1444521.csar";
416 String filePath = FileHandling.getFilePath(folder); ;
418 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
420 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
421 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
422 assertThat(errorMessage).contains(checkUIResponseOnError);
425 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
426 // TC1444531 - Update Informational Artifact With Invalid Type
428 public void updateInformationalArtifactWithInvalidType() throws Exception {
429 String folder ="US825779";
430 String fileName = "ImportTC1444531.csar";
432 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
434 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
436 fileName = "UpdateTC1444531.csar";
438 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
439 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
441 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
446 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
447 String fileName = "ValidArtifactNameInInvalidFolder.csar";
448 String folder = "US824719";
450 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
451 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
452 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
454 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
458 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
459 String fileName = "ImportTC1444533.csar";
460 String folder = "US824719";
461 String filePath = FileHandling.getFilePath(folder);
463 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
464 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
466 String updatedCsarFileName = "UpdateTC1444533.csar";
468 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
469 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
470 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
472 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
478 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
480 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
484 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
485 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
486 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
487 String filePath = FileHandling.getFilePath(folder);
488 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
490 validateDeploymentArtifactPage(deploymentArtifacts, null);
491 validateInformationalArtifactPage(informationalArtifacts, null);
493 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
495 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
496 validateInformationalArtifactInComposition(informationalArtifacts, null);
501 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
502 String filePath = FileHandling.getFilePath(folder);
503 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
504 // Insert file to the browse dialog
505 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
506 browseWebElement.sendKeys(filePath + fileName);
508 // Fill the general page fields.
509 GeneralUIUtils.waitForLoader();
510 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
511 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
517 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
518 String filePath = FileHandling.getFilePath(folder);
519 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
520 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
522 validateDeploymentArtifactPage(deploymentArtifacts, null);
523 validateInformationalArtifactPage(informationalArtifacts, null);
525 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
527 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
528 validateInformationalArtifactInComposition(informationalArtifacts, null);
531 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
532 CompositionPage.showInformationArtifactTab();
533 // Composition informational
534 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
535 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
537 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
538 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
542 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
543 CompositionPage.showDeploymentArtifactTab();
544 // Composition deployment
545 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
546 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
548 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
549 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
553 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
554 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
555 // Informational page
556 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
557 validateEachArtifactInformationPage(informationalArtifacts);
559 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
560 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
564 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
565 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
567 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
568 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
570 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
571 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
575 // TODO: add validation that if not editable / deleteable then button should not appear
576 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
577 for(ArtifactInfo artifact: artifactInfoList) {
578 String type = artifact.getArtifactType();
579 String label = artifact.getArtifactLabel();
580 String version = artifact.getArtifactVersion();
582 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
583 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
586 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
591 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
592 for(ArtifactInfo artifact: artifactInfoList) {
593 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
597 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
598 for(ArtifactInfo artifact: artifactInfoList) {
599 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
603 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
604 for(ArtifactInfo artifact: artifactInfoList) {
605 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
609 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
610 for(ArtifactInfo artifact: artifactInfoList) {
612 String type = artifact.getArtifactType();
613 String label = artifact.getArtifactLabel();
614 String filename = artifact.getFilename();
616 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
617 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
620 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
625 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
626 for(ArtifactInfo artifact: artifactInfoList) {
627 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
631 // TODO: there is defect in this flow
632 // TODO: change isEditable to false when defect fix
633 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
634 for(ArtifactInfo artifact: artifactInfoList) {
635 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
639 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
640 for(ArtifactInfo artifact: artifactInfoList) {
641 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
648 protected UserRoleEnum getRole() {
649 return UserRoleEnum.DESIGNER;