2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.execute.sanity;
23 import java.util.ArrayList;
24 import java.util.List;
26 import org.openecomp.sdc.be.dao.api.ActionStatus;
27 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
28 import org.openecomp.sdc.be.model.User;
29 import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
30 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
31 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.Dashboard;
32 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
33 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
34 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
35 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
36 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
37 import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
38 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
39 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
40 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
41 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
42 import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
43 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
44 import org.openqa.selenium.WebElement;
45 import org.testng.Assert;
46 import org.testng.SkipException;
47 import org.testng.annotations.Test;
50 public class VfDeploymentInformationalArtifacts extends SetupCDTest {
53 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
57 // US824719 - Import VSP - VF informational artifacts
58 // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
60 public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
61 String fileName = "TC1434241.csar";
62 String folder ="US825779";
64 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
65 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
66 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
67 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
69 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
72 // US824719 - Import VSP - VF informational artifacts
73 // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
75 public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
76 String fileName = "TC1434245.csar";
77 String folder ="US825779";
79 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
80 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
81 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
83 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
84 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
85 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
87 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
88 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
90 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
93 // US824719 - Import VSP - VF informational artifacts
94 // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
96 public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
99 throw new SkipException("Open bug 299719");
102 String fileName = "TC1434247.csar";
103 String folder ="US825779";
105 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
106 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
107 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
109 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
110 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
112 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
115 // US824719 - Import VSP - VF informational artifacts
116 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
118 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
121 throw new SkipException("Open bug 299719");
124 String fileName = "TC1434248.csar";
125 String folder ="US825779";
127 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
128 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
129 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
131 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
132 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
133 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
134 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
136 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
139 // US824719 - Import VSP - VF informational artifacts
140 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
142 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
145 throw new SkipException("Open bug 299719");
148 String fileName = "TC1434249.csar";
149 String folder ="US825779";
151 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
152 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
153 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
154 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
155 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
156 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
157 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
158 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
160 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
161 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
162 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
163 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
165 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
168 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
169 // TODO: re-check it after defect fix
170 // US824719 - Import VSP - VF informational artifacts
171 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
173 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
176 throw new SkipException("Open bug 299719");
179 String fileName = "DeploymentArtifactWithInvalidType.csar";
180 String folder ="US825779";
182 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
183 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
184 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
185 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
187 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
190 // US824719 - Import VSP - VF informational artifacts
191 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
193 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
196 throw new SkipException("Open bug 299719");
199 String fileName = "InformationArtifactWithInvalidType.csar";
200 String folder ="US825779";
202 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
203 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
204 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
206 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
207 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
209 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
212 // US824719 - Import VSP - VF informational artifacts
213 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
215 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
216 String folder = "US825779";
217 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
219 String fileName = "DeploymentArtifactWithLongName.csar";
221 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
223 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
224 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
225 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
228 // US824719 - Import VSP - VF informational artifacts
229 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
230 // TODO: make informational artifact name longer then 255
231 // TODO: windows/linux not allowed it
233 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
234 String folder ="US825779";
235 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
237 String fileName = "InformationArtifactWithLongName.csar";
239 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
241 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
242 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
243 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
246 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
248 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
254 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
256 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
259 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
260 // TC1443736 - Update With One New Deployment Artifact
262 public void updateWithOneNewDeploymentArtifact() throws Exception {
263 String fileName = "ImportTC1443736.csar";
264 String folder ="US825779";
266 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
268 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
269 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
271 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
273 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
275 fileName = "UpdateTC1443736.csar";
276 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
278 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
282 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
283 // TC1443737 - Update With One Removed Deployment Artifact
285 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
286 String fileName = "ImportTC1443737.csar";
287 String folder ="US825779";
289 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
291 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
292 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
293 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
294 deploymentArtifacts.add(artifactInfo);
296 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
298 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
300 fileName = "UpdateTC1443737.csar";
301 deploymentArtifacts.remove(artifactInfo);
303 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
304 deploymentArtifactsNotExist.add(artifactInfo);
306 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
309 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
310 // TC1443738 - Update With One New Version Deployment Artifact
312 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
313 String fileName = "ImportTC1443738.csar";
314 String folder ="US825779";
316 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
318 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
319 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
320 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
321 deploymentArtifacts.add(artifactInfo);
324 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
326 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
328 fileName = "UpdateTC1443738.csar";
329 artifactInfo.setArtifactVersion("2");
331 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
334 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
335 // TC1443887 - Update With One New Informational Artifact
337 public void updateWithOneNewInformationalArtifact() throws Exception {
340 throw new SkipException("Open bug 299719");
343 String fileName = "ImportTC1443887.csar";
344 String folder ="US825779";
346 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
347 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
348 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
350 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
352 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
354 fileName = "UpdateTC1443887.csar";
356 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
357 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
359 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
362 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
363 // TC1443888 - Update With One Removed Informational Artifact
365 public void updateWithOneRemovedInformationalArtifact() throws Exception {
368 throw new SkipException("Open bug 299719");
371 String folder ="US825779";
372 String fileName = "ImportTC1443888.csar";
374 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
375 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
376 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
378 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
379 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
380 informationalArtifacts.add(artifactInfo);
382 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
384 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
386 fileName = "UpdateTC1443888.csar";
388 informationalArtifacts.remove(artifactInfo);
390 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
391 informationalArtifactNotExist.add(artifactInfo);
393 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
396 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
397 // TC1443890 - Update With One New Artifact Version Informational Artifact
399 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
402 throw new SkipException("Open bug 299719");
405 String folder ="US825779";
406 String fileName = "ImportTC1443890.csar";
408 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
409 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
410 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
412 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
413 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
414 informationalArtifacts.add(artifactInfo);
416 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
418 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
420 fileName = "UpdateTC1443890.csar";
421 artifactInfo.setArtifactVersion("2");
423 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
426 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
427 // TC1443893 - Update CSAR With Same Artifacts As Imported
429 public void updateCSARWithSameArtifactsAsImported() throws Exception {
432 throw new SkipException("Open bug 299719");
435 String folder ="US825779";
436 String fileName = "ImportUpdateTC1443893.csar";
438 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
439 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
440 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
441 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
442 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
443 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
444 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
445 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
447 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
448 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
449 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
450 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
452 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
454 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
456 fileName = "ImportUpdateTC1443893.csar";
458 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
461 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
462 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
464 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
467 throw new SkipException("Open bug 299719");
470 String folder ="US825779";
471 String fileName = "ImportTC1443954.csar";
473 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
474 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
475 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
477 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
478 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
480 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
481 deploymentArtifacts.add(deploymentHeat1);
482 deploymentArtifacts.add(deploymentHeat2);
483 deploymentArtifacts.add(deploymentHeat3);
484 deploymentArtifacts.add(deploymentHeatVol1);
485 deploymentArtifacts.add(deploymentHeatVol2);
487 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
488 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
490 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
491 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
492 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
494 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
495 informationalArtifacts.add(infoGuide1);
496 informationalArtifacts.add(infoGuide2);
497 informationalArtifacts.add(infoOther1);
498 informationalArtifacts.add(infoOther2);
499 informationalArtifacts.add(infoOther3);
501 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
503 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
505 fileName = "UpdateTC1443954.csar";
507 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
508 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
510 // Changes in deployment artifacts
511 deploymentArtifactsNotExist.add(deploymentHeat1);
512 deploymentArtifactsNotExist.add(deploymentHeat2);
513 deploymentArtifacts.remove(deploymentHeat1);
514 deploymentArtifacts.remove(deploymentHeat2);
515 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
516 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
517 deploymentHeatVol1.setArtifactVersion("2");
518 deploymentHeatVol2.setArtifactVersion("2");
520 // Changes in informational artifacts
521 infoGuide1.setArtifactVersion("2");
522 infoOther1.setArtifactVersion("2");
523 informationalArtifactsNotExist.add(infoGuide2);
524 informationalArtifactsNotExist.add(infoOther2);
525 informationalArtifacts.remove(infoGuide2);
526 informationalArtifacts.remove(infoOther2);
527 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
528 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
530 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
534 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
535 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
537 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
538 String folder ="US825779";
539 String fileName = "ImportTC1444206.csar";
540 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
541 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
542 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
543 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
545 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
547 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
549 fileName = "UpdateTC1444206.csar";
550 String filePath = FileHandling.getFilePath(folder); ;
552 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
554 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
555 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
556 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
559 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
560 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
562 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
565 throw new SkipException("Open bug 299719");
568 String folder ="US825779";
569 String fileName = "ImportTC1444207.csar";
571 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
572 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
573 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
575 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
576 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
578 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
580 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
582 fileName = "UpdateTC1444207.csar";
583 String filePath = FileHandling.getFilePath(folder); ;
585 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
587 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
588 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
589 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
593 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
594 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
596 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
597 String folder ="US825779";
598 String fileName = "ImportTC1444208.csar";
600 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
601 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
602 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
603 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
605 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
607 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
609 fileName = "UpdateTC1444208.csar";
610 String filePath = FileHandling.getFilePath(folder); ;
612 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
614 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
615 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
616 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
619 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
620 // TC1444520 - Update Deployment Artifact With Name To Long
622 public void updateDeploymentArtifactWithNameToLong() throws Exception {
623 String folder ="US825779";
625 String fileName = "ImportTC1444520.csar";
627 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
629 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
631 fileName = "UpdateTC1444520.csar";
632 String filePath = FileHandling.getFilePath(folder); ;
634 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
636 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
637 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
638 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
641 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
642 // TC1444521 - Update Informational Artifact With Name To Long
644 public void updateInformationalArtifactWithNameToLong() throws Exception {
646 String folder = "US825779";
647 String fileName = "ImportTC1444521.csar";
649 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
651 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
653 fileName = "UpdateTC1444521.csar";
654 String filePath = FileHandling.getFilePath(folder); ;
656 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
658 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
659 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
660 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
663 // TODO: only after below TODO's it complete test
664 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
665 // TODO: in composition & artifact pages
666 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
667 // TC1444530 - Update Deployment Artifact With Invalid Type
669 public void updateDeploymentArtifactWithInvalidType() throws Exception {
672 throw new SkipException("Open bug 299719");
675 String folder ="US825779";
676 String fileName = "ImportTC1444530.csar";
678 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
680 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
681 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
683 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
685 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
687 fileName = "UpdateTC1444530.csar";
688 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
690 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
694 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
695 // TC1444531 - Update Informational Artifact With Invalid Type
697 public void updateInformationalArtifactWithInvalidType() throws Exception {
700 throw new SkipException("Open bug 299719");
703 String folder ="US825779";
704 String fileName = "ImportTC1444531.csar";
706 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
708 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
710 fileName = "UpdateTC1444531.csar";
712 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
713 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
715 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
720 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
721 String fileName = "ValidArtifactNameInInvalidFolder.csar";
722 String folder = "US824719";
724 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
725 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
726 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
728 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
732 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
733 String fileName = "ImportTC1444533.csar";
734 String folder = "US824719";
735 String filePath = FileHandling.getFilePath(folder);
737 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
738 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
740 String updatedCsarFileName = "UpdateTC1444533.csar";
742 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
743 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
744 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
746 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
752 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
754 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
758 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
759 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
760 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
761 String filePath = FileHandling.getFilePath(folder);
762 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
764 validateDeploymentArtifactPage(deploymentArtifacts, null);
765 validateInformationalArtifactPage(informationalArtifacts, null);
767 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
769 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
770 validateInformationalArtifactInComposition(informationalArtifacts, null);
775 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
776 String filePath = FileHandling.getFilePath(folder);
777 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
778 // Insert file to the browse dialog
779 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
780 browseWebElement.sendKeys(filePath + fileName);
782 // Fill the general page fields.
783 GeneralUIUtils.waitForLoader();
784 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
785 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
791 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
792 String filePath = FileHandling.getFilePath(folder);
793 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
794 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
796 validateDeploymentArtifactPage(deploymentArtifacts, null);
797 validateInformationalArtifactPage(informationalArtifacts, null);
799 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
801 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
802 validateInformationalArtifactInComposition(informationalArtifacts, null);
805 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
806 CompositionPage.showInformationArtifactTab();
807 // Composition informational
808 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
809 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
811 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
812 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
816 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
817 CompositionPage.showDeploymentArtifactTab();
818 // Composition deployment
819 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
820 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
822 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
823 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
827 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
828 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
829 // Informational page
830 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
831 validateEachArtifactInformationPage(informationalArtifacts);
833 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
834 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
838 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
839 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
841 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
842 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
844 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
845 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
849 // TODO: add validation that if not editable / deleteable then button should not appear
850 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
851 for(ArtifactInfo artifact: artifactInfoList) {
852 String type = artifact.getArtifactType();
853 String label = artifact.getArtifactLabel();
854 String version = artifact.getArtifactVersion();
856 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
857 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
860 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
865 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
866 for(ArtifactInfo artifact: artifactInfoList) {
867 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
871 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
872 for(ArtifactInfo artifact: artifactInfoList) {
873 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
877 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
878 for(ArtifactInfo artifact: artifactInfoList) {
879 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
883 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
884 for(ArtifactInfo artifact: artifactInfoList) {
886 String type = artifact.getArtifactType();
887 String label = artifact.getArtifactLabel();
888 String filename = artifact.getFilename();
890 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
891 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
894 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
899 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
900 for(ArtifactInfo artifact: artifactInfoList) {
901 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
905 // TODO: there is defect in this flow
906 // TODO: change isEditable to false when defect fix
907 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
908 for(ArtifactInfo artifact: artifactInfoList) {
909 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
913 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
914 for(ArtifactInfo artifact: artifactInfoList) {
915 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
922 protected UserRoleEnum getRole() {
923 return UserRoleEnum.DESIGNER;