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 java.util.ArrayList;
24 import java.util.List;
26 import org.openecomp.sdc.be.dao.api.ActionStatus;
27 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
28 import org.openecomp.sdc.be.model.User;
29 import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
30 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
31 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.Dashboard;
32 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
33 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
34 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
35 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
36 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
37 import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
38 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
39 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
40 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
41 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
42 import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
43 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
44 import org.openqa.selenium.WebElement;
45 import org.testng.Assert;
46 import org.testng.SkipException;
47 import org.testng.annotations.Test;
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 Assert.assertTrue(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 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
221 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
223 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
229 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
231 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
234 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
235 // TC1443736 - Update With One New Deployment Artifact
237 public void updateWithOneNewDeploymentArtifact() throws Exception {
240 throw new SkipException("Open bug 310971 and 369139");
243 String fileName = "ImportTC1443736.csar";
244 String folder ="US825779";
246 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
248 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
249 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
251 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
253 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
255 fileName = "UpdateTC1443736.csar";
256 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
258 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
262 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
263 // TC1443737 - Update With One Removed Deployment Artifact
265 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
268 throw new SkipException("Open bug 310971 and 369139");
271 String fileName = "ImportTC1443737.csar";
272 String folder ="US825779";
274 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
276 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
277 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
278 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
279 deploymentArtifacts.add(artifactInfo);
281 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
283 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
285 fileName = "UpdateTC1443737.csar";
286 deploymentArtifacts.remove(artifactInfo);
288 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
289 deploymentArtifactsNotExist.add(artifactInfo);
291 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
294 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
295 // TC1443738 - Update With One New Version Deployment Artifact
297 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
300 throw new SkipException("Open bug 310971 and 369139");
303 String fileName = "ImportTC1443738.csar";
304 String folder ="US825779";
306 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
308 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
309 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
310 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
311 deploymentArtifacts.add(artifactInfo);
314 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
316 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
318 fileName = "UpdateTC1443738.csar";
319 artifactInfo.setArtifactVersion("2");
321 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
324 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
325 // TC1443887 - Update With One New Informational Artifact
327 public void updateWithOneNewInformationalArtifact() throws Exception {
330 throw new SkipException("Open bug 310971 and 369139");
333 String fileName = "ImportTC1443887.csar";
334 String folder ="US825779";
336 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
337 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
338 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
340 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
342 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
344 fileName = "UpdateTC1443887.csar";
346 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
347 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
349 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
352 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
353 // TC1443888 - Update With One Removed Informational Artifact
355 public void updateWithOneRemovedInformationalArtifact() throws Exception {
358 throw new SkipException("Open bug 310971 and 369139");
361 String folder ="US825779";
362 String fileName = "ImportTC1443888.csar";
364 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
365 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
366 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
368 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
369 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
370 informationalArtifacts.add(artifactInfo);
372 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
374 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
376 fileName = "UpdateTC1443888.csar";
378 informationalArtifacts.remove(artifactInfo);
380 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
381 informationalArtifactNotExist.add(artifactInfo);
383 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
386 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
387 // TC1443890 - Update With One New Artifact Version Informational Artifact
389 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
392 throw new SkipException("Open bug 310971 and 369139");
395 String folder ="US825779";
396 String fileName = "ImportTC1443890.csar";
398 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
399 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
400 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
402 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
403 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
404 informationalArtifacts.add(artifactInfo);
406 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
408 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
410 fileName = "UpdateTC1443890.csar";
411 artifactInfo.setArtifactVersion("2");
413 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
416 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
417 // TC1443893 - Update CSAR With Same Artifacts As Imported
419 public void updateCSARWithSameArtifactsAsImported() throws Exception {
422 throw new SkipException("Open bug 310971 and 369139");
425 String folder ="US825779";
426 String fileName = "ImportUpdateTC1443893.csar";
428 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
429 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
430 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
431 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
432 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
433 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
434 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
435 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
437 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
438 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
439 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
440 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
442 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
444 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
446 fileName = "ImportUpdateTC1443893.csar";
448 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
451 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
452 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
454 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
455 String folder ="US825779";
456 String fileName = "ImportTC1443954.csar";
458 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
459 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
460 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
462 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
463 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
465 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
466 deploymentArtifacts.add(deploymentHeat1);
467 deploymentArtifacts.add(deploymentHeat2);
468 deploymentArtifacts.add(deploymentHeat3);
469 deploymentArtifacts.add(deploymentHeatVol1);
470 deploymentArtifacts.add(deploymentHeatVol2);
472 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
473 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
475 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
476 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
477 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
479 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
480 informationalArtifacts.add(infoGuide1);
481 informationalArtifacts.add(infoGuide2);
482 informationalArtifacts.add(infoOther1);
483 informationalArtifacts.add(infoOther2);
484 informationalArtifacts.add(infoOther3);
486 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
488 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
490 fileName = "UpdateTC1443954.csar";
492 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
493 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
495 // Changes in deployment artifacts
496 deploymentArtifactsNotExist.add(deploymentHeat1);
497 deploymentArtifactsNotExist.add(deploymentHeat2);
498 deploymentArtifacts.remove(deploymentHeat1);
499 deploymentArtifacts.remove(deploymentHeat2);
500 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
501 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
502 deploymentHeatVol1.setArtifactVersion("2");
503 deploymentHeatVol2.setArtifactVersion("2");
505 // Changes in informational artifacts
506 infoGuide1.setArtifactVersion("2");
507 infoOther1.setArtifactVersion("2");
508 informationalArtifactsNotExist.add(infoGuide2);
509 informationalArtifactsNotExist.add(infoOther2);
510 informationalArtifacts.remove(infoGuide2);
511 informationalArtifacts.remove(infoOther2);
512 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
513 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
515 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
519 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
520 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
522 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
523 String folder ="US825779";
524 String fileName = "ImportTC1444206.csar";
525 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
526 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
527 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
528 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
530 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
532 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
534 fileName = "UpdateTC1444206.csar";
535 String filePath = FileHandling.getFilePath(folder); ;
537 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
539 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
540 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
541 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
544 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
545 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
547 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
548 String folder ="US825779";
549 String fileName = "ImportTC1444207.csar";
551 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
552 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
553 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
555 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
556 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
558 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
560 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
562 fileName = "UpdateTC1444207.csar";
563 String filePath = FileHandling.getFilePath(folder); ;
565 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
567 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
568 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
569 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
573 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
574 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
576 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
577 String folder ="US825779";
578 String fileName = "ImportTC1444208.csar";
580 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
581 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
582 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
583 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
585 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
587 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
589 fileName = "UpdateTC1444208.csar";
590 String filePath = FileHandling.getFilePath(folder); ;
592 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
594 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
595 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
596 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
599 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
600 // TC1444520 - Update Deployment Artifact With Name To Long
602 public void updateDeploymentArtifactWithNameToLong() throws Exception {
603 String folder ="US825779";
605 String fileName = "ImportTC1444520.csar";
607 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
609 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
611 fileName = "UpdateTC1444520.csar";
612 String filePath = FileHandling.getFilePath(folder); ;
614 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
616 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
617 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
618 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
621 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
622 // TC1444521 - Update Informational Artifact With Name To Long
624 public void updateInformationalArtifactWithNameToLong() throws Exception {
626 String folder = "US825779";
627 String fileName = "ImportTC1444521.csar";
629 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
631 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
633 fileName = "UpdateTC1444521.csar";
634 String filePath = FileHandling.getFilePath(folder); ;
636 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
638 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
639 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
640 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
643 // TODO: only after below TODO's it complete test
644 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
645 // TODO: in composition & artifact pages
646 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
647 // TC1444530 - Update Deployment Artifact With Invalid Type
649 public void updateDeploymentArtifactWithInvalidType() throws Exception {
652 throw new SkipException("Open bug 310971 and 369139");
655 String folder ="US825779";
656 String fileName = "ImportTC1444530.csar";
658 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
660 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
661 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
663 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
665 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
667 fileName = "UpdateTC1444530.csar";
668 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
670 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
674 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
675 // TC1444531 - Update Informational Artifact With Invalid Type
677 public void updateInformationalArtifactWithInvalidType() throws Exception {
678 String folder ="US825779";
679 String fileName = "ImportTC1444531.csar";
681 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
683 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
685 fileName = "UpdateTC1444531.csar";
687 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
688 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
690 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
695 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
696 String fileName = "ValidArtifactNameInInvalidFolder.csar";
697 String folder = "US824719";
699 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
700 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
701 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
703 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
707 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
708 String fileName = "ImportTC1444533.csar";
709 String folder = "US824719";
710 String filePath = FileHandling.getFilePath(folder);
712 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
713 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
715 String updatedCsarFileName = "UpdateTC1444533.csar";
717 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
718 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
719 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
721 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
727 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
729 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
733 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
734 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
735 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
736 String filePath = FileHandling.getFilePath(folder);
737 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
739 validateDeploymentArtifactPage(deploymentArtifacts, null);
740 validateInformationalArtifactPage(informationalArtifacts, null);
742 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
744 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
745 validateInformationalArtifactInComposition(informationalArtifacts, null);
750 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
751 String filePath = FileHandling.getFilePath(folder);
752 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
753 // Insert file to the browse dialog
754 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
755 browseWebElement.sendKeys(filePath + fileName);
757 // Fill the general page fields.
758 GeneralUIUtils.waitForLoader();
759 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
760 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
766 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
767 String filePath = FileHandling.getFilePath(folder);
768 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
769 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
771 validateDeploymentArtifactPage(deploymentArtifacts, null);
772 validateInformationalArtifactPage(informationalArtifacts, null);
774 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
776 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
777 validateInformationalArtifactInComposition(informationalArtifacts, null);
780 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
781 CompositionPage.showInformationArtifactTab();
782 // Composition informational
783 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
784 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
786 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
787 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
791 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
792 CompositionPage.showDeploymentArtifactTab();
793 // Composition deployment
794 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
795 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
797 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
798 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
802 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
803 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
804 // Informational page
805 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
806 validateEachArtifactInformationPage(informationalArtifacts);
808 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
809 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
813 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
814 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
816 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
817 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
819 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
820 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
824 // TODO: add validation that if not editable / deleteable then button should not appear
825 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
826 for(ArtifactInfo artifact: artifactInfoList) {
827 String type = artifact.getArtifactType();
828 String label = artifact.getArtifactLabel();
829 String version = artifact.getArtifactVersion();
831 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
832 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
835 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
840 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
841 for(ArtifactInfo artifact: artifactInfoList) {
842 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
846 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
847 for(ArtifactInfo artifact: artifactInfoList) {
848 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
852 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
853 for(ArtifactInfo artifact: artifactInfoList) {
854 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
858 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
859 for(ArtifactInfo artifact: artifactInfoList) {
861 String type = artifact.getArtifactType();
862 String label = artifact.getArtifactLabel();
863 String filename = artifact.getFilename();
865 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
866 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
869 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
874 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
875 for(ArtifactInfo artifact: artifactInfoList) {
876 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
880 // TODO: there is defect in this flow
881 // TODO: change isEditable to false when defect fix
882 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
883 for(ArtifactInfo artifact: artifactInfoList) {
884 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
888 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
889 for(ArtifactInfo artifact: artifactInfoList) {
890 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
897 protected UserRoleEnum getRole() {
898 return UserRoleEnum.DESIGNER;