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 {
63 throw new SkipException("Open bug 320081");
65 String fileName = "TC1434241.csar";
66 String folder ="US825779";
68 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
69 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
70 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
71 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
73 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
76 // US824719 - Import VSP - VF informational artifacts
77 // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
79 public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
82 throw new SkipException("Open bug 320081");
84 String fileName = "TC1434245.csar";
85 String folder ="US825779";
87 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
88 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
89 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
91 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
92 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
93 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
95 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
96 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
98 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
101 // US824719 - Import VSP - VF informational artifacts
102 // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
104 public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
107 throw new SkipException("Open bug 299719");
110 String fileName = "TC1434247.csar";
111 String folder ="US825779";
113 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
114 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
115 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
117 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
118 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
120 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
123 // US824719 - Import VSP - VF informational artifacts
124 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
126 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
129 throw new SkipException("Open bug 299719");
132 String fileName = "TC1434248.csar";
133 String folder ="US825779";
135 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
136 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
137 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
139 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
140 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
141 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
142 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
144 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
147 // US824719 - Import VSP - VF informational artifacts
148 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
150 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
153 throw new SkipException("Open bug 299719");
156 String fileName = "TC1434249.csar";
157 String folder ="US825779";
159 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
160 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
161 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
162 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
163 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
164 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
165 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
166 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
168 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
169 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
170 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
171 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
173 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
176 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
177 // TODO: re-check it after defect fix
178 // US824719 - Import VSP - VF informational artifacts
179 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
181 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
184 throw new SkipException("Open bug 299719");
187 String fileName = "DeploymentArtifactWithInvalidType.csar";
188 String folder ="US825779";
190 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
191 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
192 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
193 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
195 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
198 // US824719 - Import VSP - VF informational artifacts
199 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
201 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
204 throw new SkipException("Open bug 299719");
207 String fileName = "InformationArtifactWithInvalidType.csar";
208 String folder ="US825779";
210 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
211 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
212 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
214 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
215 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
217 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
220 // US824719 - Import VSP - VF informational artifacts
221 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
223 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
224 String folder = "US825779";
225 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
227 String fileName = "DeploymentArtifactWithLongName.csar";
229 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
231 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
232 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
233 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
236 // US824719 - Import VSP - VF informational artifacts
237 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
238 // TODO: make informational artifact name longer then 255
239 // TODO: windows/linux not allowed it
241 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
242 String folder ="US825779";
243 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
245 String fileName = "InformationArtifactWithLongName.csar";
247 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
249 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
250 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
251 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
254 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
256 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
262 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
264 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
267 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
268 // TC1443736 - Update With One New Deployment Artifact
270 public void updateWithOneNewDeploymentArtifact() throws Exception {
271 String fileName = "ImportTC1443736.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"));
279 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
281 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
283 fileName = "UpdateTC1443736.csar";
284 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
286 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
290 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
291 // TC1443737 - Update With One Removed Deployment Artifact
293 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
294 String fileName = "ImportTC1443737.csar";
295 String folder ="US825779";
297 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
299 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
300 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
301 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
302 deploymentArtifacts.add(artifactInfo);
304 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
306 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
308 fileName = "UpdateTC1443737.csar";
309 deploymentArtifacts.remove(artifactInfo);
311 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
312 deploymentArtifactsNotExist.add(artifactInfo);
314 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
317 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
318 // TC1443738 - Update With One New Version Deployment Artifact
320 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
321 String fileName = "ImportTC1443738.csar";
322 String folder ="US825779";
324 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
326 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
327 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
328 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
329 deploymentArtifacts.add(artifactInfo);
332 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
334 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
336 fileName = "UpdateTC1443738.csar";
337 artifactInfo.setArtifactVersion("2");
339 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
342 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
343 // TC1443887 - Update With One New Informational Artifact
345 public void updateWithOneNewInformationalArtifact() throws Exception {
348 throw new SkipException("Open bug 299719");
351 String fileName = "ImportTC1443887.csar";
352 String folder ="US825779";
354 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
355 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
356 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
358 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
360 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
362 fileName = "UpdateTC1443887.csar";
364 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
365 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
367 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
370 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
371 // TC1443888 - Update With One Removed Informational Artifact
373 public void updateWithOneRemovedInformationalArtifact() throws Exception {
376 throw new SkipException("Open bug 299719");
379 String folder ="US825779";
380 String fileName = "ImportTC1443888.csar";
382 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
383 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
384 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
386 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
387 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
388 informationalArtifacts.add(artifactInfo);
390 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
392 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
394 fileName = "UpdateTC1443888.csar";
396 informationalArtifacts.remove(artifactInfo);
398 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
399 informationalArtifactNotExist.add(artifactInfo);
401 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
404 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
405 // TC1443890 - Update With One New Artifact Version Informational Artifact
407 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
410 throw new SkipException("Open bug 299719");
413 String folder ="US825779";
414 String fileName = "ImportTC1443890.csar";
416 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
417 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
418 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
420 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
421 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
422 informationalArtifacts.add(artifactInfo);
424 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
426 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
428 fileName = "UpdateTC1443890.csar";
429 artifactInfo.setArtifactVersion("2");
431 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
434 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
435 // TC1443893 - Update CSAR With Same Artifacts As Imported
437 public void updateCSARWithSameArtifactsAsImported() throws Exception {
440 throw new SkipException("Open bug 299719");
443 String folder ="US825779";
444 String fileName = "ImportUpdateTC1443893.csar";
446 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
447 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
448 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
449 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
450 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
451 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
452 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
453 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
455 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
456 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
457 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
458 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
460 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
462 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
464 fileName = "ImportUpdateTC1443893.csar";
466 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
469 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
470 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
472 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
475 throw new SkipException("Open bug 299719");
478 String folder ="US825779";
479 String fileName = "ImportTC1443954.csar";
481 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
482 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
483 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
485 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
486 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
488 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
489 deploymentArtifacts.add(deploymentHeat1);
490 deploymentArtifacts.add(deploymentHeat2);
491 deploymentArtifacts.add(deploymentHeat3);
492 deploymentArtifacts.add(deploymentHeatVol1);
493 deploymentArtifacts.add(deploymentHeatVol2);
495 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
496 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
498 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
499 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
500 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
502 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
503 informationalArtifacts.add(infoGuide1);
504 informationalArtifacts.add(infoGuide2);
505 informationalArtifacts.add(infoOther1);
506 informationalArtifacts.add(infoOther2);
507 informationalArtifacts.add(infoOther3);
509 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
511 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
513 fileName = "UpdateTC1443954.csar";
515 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
516 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
518 // Changes in deployment artifacts
519 deploymentArtifactsNotExist.add(deploymentHeat1);
520 deploymentArtifactsNotExist.add(deploymentHeat2);
521 deploymentArtifacts.remove(deploymentHeat1);
522 deploymentArtifacts.remove(deploymentHeat2);
523 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
524 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
525 deploymentHeatVol1.setArtifactVersion("2");
526 deploymentHeatVol2.setArtifactVersion("2");
528 // Changes in informational artifacts
529 infoGuide1.setArtifactVersion("2");
530 infoOther1.setArtifactVersion("2");
531 informationalArtifactsNotExist.add(infoGuide2);
532 informationalArtifactsNotExist.add(infoOther2);
533 informationalArtifacts.remove(infoGuide2);
534 informationalArtifacts.remove(infoOther2);
535 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
536 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
538 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
542 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
543 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
545 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
546 String folder ="US825779";
547 String fileName = "ImportTC1444206.csar";
549 throw new SkipException("Open bug 320081");
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"));
554 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
556 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
558 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
560 fileName = "UpdateTC1444206.csar";
561 String filePath = FileHandling.getFilePath(folder); ;
563 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
565 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
566 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
567 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
570 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
571 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
573 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
576 throw new SkipException("Open bug 299719");
579 String folder ="US825779";
580 String fileName = "ImportTC1444207.csar";
582 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
583 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
584 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
586 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
587 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
589 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
591 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
593 fileName = "UpdateTC1444207.csar";
594 String filePath = FileHandling.getFilePath(folder); ;
596 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
598 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
599 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
600 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
604 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
605 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
607 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
610 throw new SkipException("Open bug 320081");
612 String folder ="US825779";
613 String fileName = "ImportTC1444208.csar";
615 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
616 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
617 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
618 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
620 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
622 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
624 fileName = "UpdateTC1444208.csar";
625 String filePath = FileHandling.getFilePath(folder); ;
627 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
629 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
630 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
631 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
634 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
635 // TC1444520 - Update Deployment Artifact With Name To Long
637 public void updateDeploymentArtifactWithNameToLong() throws Exception {
638 String folder ="US825779";
640 String fileName = "ImportTC1444520.csar";
642 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
644 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
646 fileName = "UpdateTC1444520.csar";
647 String filePath = FileHandling.getFilePath(folder); ;
649 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
651 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
652 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
653 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
656 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
657 // TC1444521 - Update Informational Artifact With Name To Long
659 public void updateInformationalArtifactWithNameToLong() throws Exception {
661 String folder = "US825779";
662 String fileName = "ImportTC1444521.csar";
664 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
666 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
668 fileName = "UpdateTC1444521.csar";
669 String filePath = FileHandling.getFilePath(folder); ;
671 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
673 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
674 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
675 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
678 // TODO: only after below TODO's it complete test
679 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
680 // TODO: in composition & artifact pages
681 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
682 // TC1444530 - Update Deployment Artifact With Invalid Type
684 public void updateDeploymentArtifactWithInvalidType() throws Exception {
687 throw new SkipException("Open bug 299719");
690 String folder ="US825779";
691 String fileName = "ImportTC1444530.csar";
693 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
695 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
696 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
698 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
700 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
702 fileName = "UpdateTC1444530.csar";
703 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
705 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
709 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
710 // TC1444531 - Update Informational Artifact With Invalid Type
712 public void updateInformationalArtifactWithInvalidType() throws Exception {
715 throw new SkipException("Open bug 299719");
718 String folder ="US825779";
719 String fileName = "ImportTC1444531.csar";
721 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
723 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
725 fileName = "UpdateTC1444531.csar";
727 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
728 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
730 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
735 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
738 throw new SkipException("Open bug 320081");
740 String fileName = "ValidArtifactNameInInvalidFolder.csar";
741 String folder = "US824719";
743 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
744 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
745 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
747 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
751 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
753 throw new SkipException("Open bug 320081");
756 String fileName = "ImportTC1444533.csar";
757 String folder = "US824719";
758 String filePath = FileHandling.getFilePath(folder);
760 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
761 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
763 String updatedCsarFileName = "UpdateTC1444533.csar";
765 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
766 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
767 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
769 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
775 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
777 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
781 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
782 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
783 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
784 String filePath = FileHandling.getFilePath(folder);
785 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
787 validateDeploymentArtifactPage(deploymentArtifacts, null);
788 validateInformationalArtifactPage(informationalArtifacts, null);
790 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
792 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
793 validateInformationalArtifactInComposition(informationalArtifacts, null);
798 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
799 String filePath = FileHandling.getFilePath(folder);
800 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
801 // Insert file to the browse dialog
802 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
803 browseWebElement.sendKeys(filePath + fileName);
805 // Fill the general page fields.
806 GeneralUIUtils.waitForLoader();
807 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
808 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
814 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
815 String filePath = FileHandling.getFilePath(folder);
816 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
817 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
819 validateDeploymentArtifactPage(deploymentArtifacts, null);
820 validateInformationalArtifactPage(informationalArtifacts, null);
822 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
824 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
825 validateInformationalArtifactInComposition(informationalArtifacts, null);
828 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
829 CompositionPage.showInformationArtifactTab();
830 // Composition informational
831 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
832 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
834 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
835 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
839 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
840 CompositionPage.showDeploymentArtifactTab();
841 // Composition deployment
842 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
843 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
845 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
846 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
850 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
851 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
852 // Informational page
853 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
854 validateEachArtifactInformationPage(informationalArtifacts);
856 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
857 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
861 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
862 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
864 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
865 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
867 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
868 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
872 // TODO: add validation that if not editable / deleteable then button should not appear
873 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
874 for(ArtifactInfo artifact: artifactInfoList) {
875 String type = artifact.getArtifactType();
876 String label = artifact.getArtifactLabel();
877 String version = artifact.getArtifactVersion();
879 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
880 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
883 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
888 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
889 for(ArtifactInfo artifact: artifactInfoList) {
890 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
894 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
895 for(ArtifactInfo artifact: artifactInfoList) {
896 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
900 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
901 for(ArtifactInfo artifact: artifactInfoList) {
902 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
906 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
907 for(ArtifactInfo artifact: artifactInfoList) {
909 String type = artifact.getArtifactType();
910 String label = artifact.getArtifactLabel();
911 String filename = artifact.getFilename();
913 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
914 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
917 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
922 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
923 for(ArtifactInfo artifact: artifactInfoList) {
924 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
928 // TODO: there is defect in this flow
929 // TODO: change isEditable to false when defect fix
930 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
931 for(ArtifactInfo artifact: artifactInfoList) {
932 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
936 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
937 for(ArtifactInfo artifact: artifactInfoList) {
938 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
945 protected UserRoleEnum getRole() {
946 return UserRoleEnum.DESIGNER;