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"));
67 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
68 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
70 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
73 // US824719 - Import VSP - VF informational artifacts
74 // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
76 public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
77 String fileName = "TC1434245.csar";
78 String folder ="US825779";
80 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
81 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
82 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
84 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
85 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
86 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
88 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
89 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
91 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
94 // US824719 - Import VSP - VF informational artifacts
95 // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
97 public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
100 throw new SkipException("Open bug 299719");
103 String fileName = "TC1434247.csar";
104 String folder ="US825779";
106 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
107 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
108 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
110 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
111 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
113 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
116 // US824719 - Import VSP - VF informational artifacts
117 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
119 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
122 throw new SkipException("Open bug 299719");
125 String fileName = "TC1434248.csar";
126 String folder ="US825779";
128 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
129 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
130 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
132 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
133 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
134 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
135 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
137 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
140 // US824719 - Import VSP - VF informational artifacts
141 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
143 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
146 throw new SkipException("Open bug 299719");
149 String fileName = "TC1434249.csar";
150 String folder ="US825779";
152 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
153 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
154 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
155 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
156 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
157 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
158 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
159 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
161 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
162 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
163 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
164 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
166 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
169 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
170 // TODO: re-check it after defect fix
171 // US824719 - Import VSP - VF informational artifacts
172 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
174 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
177 throw new SkipException("Open bug 299719");
180 String fileName = "DeploymentArtifactWithInvalidType.csar";
181 String folder ="US825779";
183 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
184 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
185 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
186 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
188 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
191 // US824719 - Import VSP - VF informational artifacts
192 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
194 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
197 throw new SkipException("Open bug 299719");
200 String fileName = "InformationArtifactWithInvalidType.csar";
201 String folder ="US825779";
203 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
204 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
205 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
207 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
208 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
210 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
213 // US824719 - Import VSP - VF informational artifacts
214 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
216 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
217 String folder = "US825779";
218 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
220 String fileName = "DeploymentArtifactWithLongName.csar";
222 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
224 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
225 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
226 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
229 // US824719 - Import VSP - VF informational artifacts
230 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
231 // TODO: make informational artifact name longer then 255
232 // TODO: windows/linux not allowed it
234 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
235 String folder ="US825779";
236 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
238 String fileName = "InformationArtifactWithLongName.csar";
240 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
242 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
243 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
244 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
247 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
249 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
255 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
257 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
260 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
261 // TC1443736 - Update With One New Deployment Artifact
263 public void updateWithOneNewDeploymentArtifact() throws Exception {
264 String fileName = "ImportTC1443736.csar";
265 String folder ="US825779";
267 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
269 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
270 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
272 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
274 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
276 fileName = "UpdateTC1443736.csar";
277 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
279 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
283 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
284 // TC1443737 - Update With One Removed Deployment Artifact
286 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
287 String fileName = "ImportTC1443737.csar";
288 String folder ="US825779";
290 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
292 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
293 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
294 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
295 deploymentArtifacts.add(artifactInfo);
297 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
299 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
301 fileName = "UpdateTC1443737.csar";
302 deploymentArtifacts.remove(artifactInfo);
304 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
305 deploymentArtifactsNotExist.add(artifactInfo);
307 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
310 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
311 // TC1443738 - Update With One New Version Deployment Artifact
313 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
314 String fileName = "ImportTC1443738.csar";
315 String folder ="US825779";
317 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
319 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
320 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
321 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
322 deploymentArtifacts.add(artifactInfo);
325 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
327 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
329 fileName = "UpdateTC1443738.csar";
330 artifactInfo.setArtifactVersion("2");
332 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
335 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
336 // TC1443887 - Update With One New Informational Artifact
338 public void updateWithOneNewInformationalArtifact() throws Exception {
341 throw new SkipException("Open bug 299719");
344 String fileName = "ImportTC1443887.csar";
345 String folder ="US825779";
347 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
348 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
349 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
351 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
353 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
355 fileName = "UpdateTC1443887.csar";
357 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
358 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
360 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
363 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
364 // TC1443888 - Update With One Removed Informational Artifact
366 public void updateWithOneRemovedInformationalArtifact() throws Exception {
369 throw new SkipException("Open bug 299719");
372 String folder ="US825779";
373 String fileName = "ImportTC1443888.csar";
375 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
376 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
377 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
379 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
380 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
381 informationalArtifacts.add(artifactInfo);
383 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
385 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
387 fileName = "UpdateTC1443888.csar";
389 informationalArtifacts.remove(artifactInfo);
391 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
392 informationalArtifactNotExist.add(artifactInfo);
394 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
397 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
398 // TC1443890 - Update With One New Artifact Version Informational Artifact
400 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
403 throw new SkipException("Open bug 299719");
406 String folder ="US825779";
407 String fileName = "ImportTC1443890.csar";
409 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
410 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
411 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
413 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
414 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
415 informationalArtifacts.add(artifactInfo);
417 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
419 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
421 fileName = "UpdateTC1443890.csar";
422 artifactInfo.setArtifactVersion("2");
424 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
427 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
428 // TC1443893 - Update CSAR With Same Artifacts As Imported
430 public void updateCSARWithSameArtifactsAsImported() throws Exception {
433 throw new SkipException("Open bug 299719");
436 String folder ="US825779";
437 String fileName = "ImportUpdateTC1443893.csar";
439 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
440 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
441 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
442 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
443 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
444 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
445 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
446 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
448 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
449 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
450 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
451 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
453 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
455 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
457 fileName = "ImportUpdateTC1443893.csar";
459 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
462 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
463 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
465 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
468 throw new SkipException("Open bug 299719");
471 String folder ="US825779";
472 String fileName = "ImportTC1443954.csar";
474 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
475 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
476 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
478 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
479 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
481 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
482 deploymentArtifacts.add(deploymentHeat1);
483 deploymentArtifacts.add(deploymentHeat2);
484 deploymentArtifacts.add(deploymentHeat3);
485 deploymentArtifacts.add(deploymentHeatVol1);
486 deploymentArtifacts.add(deploymentHeatVol2);
488 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
489 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
491 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
492 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
493 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
495 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
496 informationalArtifacts.add(infoGuide1);
497 informationalArtifacts.add(infoGuide2);
498 informationalArtifacts.add(infoOther1);
499 informationalArtifacts.add(infoOther2);
500 informationalArtifacts.add(infoOther3);
502 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
504 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
506 fileName = "UpdateTC1443954.csar";
508 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
509 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
511 // Changes in deployment artifacts
512 deploymentArtifactsNotExist.add(deploymentHeat1);
513 deploymentArtifactsNotExist.add(deploymentHeat2);
514 deploymentArtifacts.remove(deploymentHeat1);
515 deploymentArtifacts.remove(deploymentHeat2);
516 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
517 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
518 deploymentHeatVol1.setArtifactVersion("2");
519 deploymentHeatVol2.setArtifactVersion("2");
521 // Changes in informational artifacts
522 infoGuide1.setArtifactVersion("2");
523 infoOther1.setArtifactVersion("2");
524 informationalArtifactsNotExist.add(infoGuide2);
525 informationalArtifactsNotExist.add(infoOther2);
526 informationalArtifacts.remove(infoGuide2);
527 informationalArtifacts.remove(infoOther2);
528 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
529 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
531 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
535 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
536 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
538 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
539 String folder ="US825779";
540 String fileName = "ImportTC1444206.csar";
542 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
543 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
544 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
545 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
547 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
549 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
551 fileName = "UpdateTC1444206.csar";
552 String filePath = FileHandling.getFilePath(folder); ;
554 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
556 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
557 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
558 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
561 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
562 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
564 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
567 throw new SkipException("Open bug 299719");
570 String folder ="US825779";
571 String fileName = "ImportTC1444207.csar";
573 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
574 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
575 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
577 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
578 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
580 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
582 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
584 fileName = "UpdateTC1444207.csar";
585 String filePath = FileHandling.getFilePath(folder); ;
587 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
589 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
590 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
591 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
595 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
596 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
598 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
599 String folder ="US825779";
600 String fileName = "ImportTC1444208.csar";
602 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
603 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
604 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
605 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
607 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
609 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
611 fileName = "UpdateTC1444208.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.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
618 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
621 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
622 // TC1444520 - Update Deployment Artifact With Name To Long
624 public void updateDeploymentArtifactWithNameToLong() throws Exception {
625 String folder ="US825779";
627 String fileName = "ImportTC1444520.csar";
629 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
631 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
633 fileName = "UpdateTC1444520.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 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
644 // TC1444521 - Update Informational Artifact With Name To Long
646 public void updateInformationalArtifactWithNameToLong() throws Exception {
648 String folder = "US825779";
649 String fileName = "ImportTC1444521.csar";
651 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
653 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
655 fileName = "UpdateTC1444521.csar";
656 String filePath = FileHandling.getFilePath(folder); ;
658 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
660 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
661 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
662 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
665 // TODO: only after below TODO's it complete test
666 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
667 // TODO: in composition & artifact pages
668 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
669 // TC1444530 - Update Deployment Artifact With Invalid Type
671 public void updateDeploymentArtifactWithInvalidType() throws Exception {
674 throw new SkipException("Open bug 299719");
677 String folder ="US825779";
678 String fileName = "ImportTC1444530.csar";
680 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
682 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
683 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
685 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
687 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
689 fileName = "UpdateTC1444530.csar";
690 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
692 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
696 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
697 // TC1444531 - Update Informational Artifact With Invalid Type
699 public void updateInformationalArtifactWithInvalidType() throws Exception {
702 throw new SkipException("Open bug 299719");
705 String folder ="US825779";
706 String fileName = "ImportTC1444531.csar";
708 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
710 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
712 fileName = "UpdateTC1444531.csar";
714 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
715 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
717 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
722 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
723 String fileName = "ValidArtifactNameInInvalidFolder.csar";
724 String folder = "US824719";
726 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
727 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
728 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
730 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
734 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
735 String fileName = "ImportTC1444533.csar";
736 String folder = "US824719";
737 String filePath = FileHandling.getFilePath(folder);
738 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
739 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
741 String updatedCsarFileName = "UpdateTC1444533.csar";
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(), "1"));
747 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
753 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
755 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
759 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
760 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
761 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
762 String filePath = FileHandling.getFilePath(folder);
763 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
765 validateDeploymentArtifactPage(deploymentArtifacts, null);
766 validateInformationalArtifactPage(informationalArtifacts, null);
768 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
770 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
771 validateInformationalArtifactInComposition(informationalArtifacts, null);
776 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
777 String filePath = FileHandling.getFilePath(folder);
778 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
779 // Insert file to the browse dialog
780 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
781 browseWebElement.sendKeys(filePath + fileName);
783 // Fill the general page fields.
784 GeneralUIUtils.waitForLoader();
785 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
786 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
792 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
793 String filePath = FileHandling.getFilePath(folder);
794 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
795 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
797 validateDeploymentArtifactPage(deploymentArtifacts, null);
798 validateInformationalArtifactPage(informationalArtifacts, null);
800 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
802 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
803 validateInformationalArtifactInComposition(informationalArtifacts, null);
806 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
807 CompositionPage.showInformationArtifactTab();
808 // Composition informational
809 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
810 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
812 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
813 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
817 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
818 CompositionPage.showDeploymentArtifactTab();
819 // Composition deployment
820 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
821 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
823 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
824 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
828 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
829 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
830 // Informational page
831 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
832 validateEachArtifactInformationPage(informationalArtifacts);
834 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
835 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
839 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
840 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
842 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
843 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
845 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
846 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
850 // TODO: add validation that if not editable / deleteable then button should not appear
851 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
852 for(ArtifactInfo artifact: artifactInfoList) {
853 String type = artifact.getArtifactType();
854 String label = artifact.getArtifactLabel();
855 String version = artifact.getArtifactVersion();
857 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
858 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
861 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
866 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
867 for(ArtifactInfo artifact: artifactInfoList) {
868 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
872 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
873 for(ArtifactInfo artifact: artifactInfoList) {
874 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
878 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
879 for(ArtifactInfo artifact: artifactInfoList) {
880 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
884 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
885 for(ArtifactInfo artifact: artifactInfoList) {
887 String type = artifact.getArtifactType();
888 String label = artifact.getArtifactLabel();
889 String filename = artifact.getFilename();
891 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
892 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
895 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
900 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
901 for(ArtifactInfo artifact: artifactInfoList) {
902 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
906 // TODO: there is defect in this flow
907 // TODO: change isEditable to false when defect fix
908 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
909 for(ArtifactInfo artifact: artifactInfoList) {
910 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
914 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
915 for(ArtifactInfo artifact: artifactInfoList) {
916 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
923 protected UserRoleEnum getRole() {
924 return UserRoleEnum.DESIGNER;