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 {
98 String fileName = "TC1434247.csar";
99 String folder ="US825779";
101 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
102 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
103 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
105 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
106 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
108 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
111 // US824719 - Import VSP - VF informational artifacts
112 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
114 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
115 String fileName = "TC1434248.csar";
116 String folder ="US825779";
118 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
119 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
120 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
122 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
123 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
124 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
125 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
127 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
130 // US824719 - Import VSP - VF informational artifacts
131 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
133 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
134 String fileName = "TC1434249.csar";
135 String folder ="US825779";
137 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
138 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
139 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
140 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
141 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
142 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
143 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
144 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
146 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
147 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
148 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
149 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
151 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
154 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
155 // TODO: re-check it after defect fix
156 // US824719 - Import VSP - VF informational artifacts
157 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
159 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
160 String fileName = "DeploymentArtifactWithInvalidType.csar";
161 String folder ="US825779";
163 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
164 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
165 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
166 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
168 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
171 // US824719 - Import VSP - VF informational artifacts
172 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
174 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
175 String fileName = "InformationArtifactWithInvalidType.csar";
176 String folder ="US825779";
178 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
179 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
180 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
182 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
183 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
185 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
188 // US824719 - Import VSP - VF informational artifacts
189 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
191 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
192 String folder = "US825779";
193 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
195 String fileName = "DeploymentArtifactWithLongName.csar";
197 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
199 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
200 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
201 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
204 // US824719 - Import VSP - VF informational artifacts
205 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
206 // TODO: make informational artifact name longer then 255
207 // TODO: windows/linux not allowed it
209 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
210 String folder ="US825779";
211 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
213 String fileName = "InformationArtifactWithLongName.csar";
215 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
217 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
218 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
219 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
222 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
224 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
230 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
232 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
235 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
236 // TC1443736 - Update With One New Deployment Artifact
238 public void updateWithOneNewDeploymentArtifact() throws Exception {
239 String fileName = "ImportTC1443736.csar";
240 String folder ="US825779";
242 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
244 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
245 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
247 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
249 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
251 fileName = "UpdateTC1443736.csar";
252 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
254 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
258 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
259 // TC1443737 - Update With One Removed Deployment Artifact
261 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
262 String fileName = "ImportTC1443737.csar";
263 String folder ="US825779";
265 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
267 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
268 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
269 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
270 deploymentArtifacts.add(artifactInfo);
272 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
274 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
276 fileName = "UpdateTC1443737.csar";
277 deploymentArtifacts.remove(artifactInfo);
279 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
280 deploymentArtifactsNotExist.add(artifactInfo);
282 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
285 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
286 // TC1443738 - Update With One New Version Deployment Artifact
288 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
289 String fileName = "ImportTC1443738.csar";
290 String folder ="US825779";
292 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
294 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
295 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
296 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
297 deploymentArtifacts.add(artifactInfo);
300 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
302 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
304 fileName = "UpdateTC1443738.csar";
305 artifactInfo.setArtifactVersion("2");
307 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
310 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
311 // TC1443887 - Update With One New Informational Artifact
313 public void updateWithOneNewInformationalArtifact() throws Exception {
314 String fileName = "ImportTC1443887.csar";
315 String folder ="US825779";
317 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
318 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
319 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
321 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
323 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
325 fileName = "UpdateTC1443887.csar";
327 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
328 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
330 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
333 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
334 // TC1443888 - Update With One Removed Informational Artifact
336 public void updateWithOneRemovedInformationalArtifact() throws Exception {
337 String folder ="US825779";
338 String fileName = "ImportTC1443888.csar";
340 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
341 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
342 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
344 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
345 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
346 informationalArtifacts.add(artifactInfo);
348 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
350 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
352 fileName = "UpdateTC1443888.csar";
354 informationalArtifacts.remove(artifactInfo);
356 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
357 informationalArtifactNotExist.add(artifactInfo);
359 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
362 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
363 // TC1443890 - Update With One New Artifact Version Informational Artifact
365 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
366 String folder ="US825779";
367 String fileName = "ImportTC1443890.csar";
369 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
370 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
371 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
373 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
374 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
375 informationalArtifacts.add(artifactInfo);
377 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
379 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
381 fileName = "UpdateTC1443890.csar";
382 artifactInfo.setArtifactVersion("2");
384 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
387 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
388 // TC1443893 - Update CSAR With Same Artifacts As Imported
390 public void updateCSARWithSameArtifactsAsImported() throws Exception {
391 String folder ="US825779";
392 String fileName = "ImportUpdateTC1443893.csar";
394 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
395 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
396 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
397 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
398 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
399 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
400 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
401 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
403 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
404 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
405 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
406 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
408 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
410 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
412 fileName = "ImportUpdateTC1443893.csar";
414 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
417 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
418 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
420 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
421 String folder ="US825779";
422 String fileName = "ImportTC1443954.csar";
424 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
425 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
426 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
428 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
429 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
431 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
432 deploymentArtifacts.add(deploymentHeat1);
433 deploymentArtifacts.add(deploymentHeat2);
434 deploymentArtifacts.add(deploymentHeat3);
435 deploymentArtifacts.add(deploymentHeatVol1);
436 deploymentArtifacts.add(deploymentHeatVol2);
438 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
439 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
441 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
442 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
443 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
445 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
446 informationalArtifacts.add(infoGuide1);
447 informationalArtifacts.add(infoGuide2);
448 informationalArtifacts.add(infoOther1);
449 informationalArtifacts.add(infoOther2);
450 informationalArtifacts.add(infoOther3);
452 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
454 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
456 fileName = "UpdateTC1443954.csar";
458 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
459 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
461 // Changes in deployment artifacts
462 deploymentArtifactsNotExist.add(deploymentHeat1);
463 deploymentArtifactsNotExist.add(deploymentHeat2);
464 deploymentArtifacts.remove(deploymentHeat1);
465 deploymentArtifacts.remove(deploymentHeat2);
466 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
467 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
468 deploymentHeatVol1.setArtifactVersion("2");
469 deploymentHeatVol2.setArtifactVersion("2");
471 // Changes in informational artifacts
472 infoGuide1.setArtifactVersion("2");
473 infoOther1.setArtifactVersion("2");
474 informationalArtifactsNotExist.add(infoGuide2);
475 informationalArtifactsNotExist.add(infoOther2);
476 informationalArtifacts.remove(infoGuide2);
477 informationalArtifacts.remove(infoOther2);
478 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
479 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
481 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
485 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
486 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
488 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
489 String folder ="US825779";
490 String fileName = "ImportTC1444206.csar";
492 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
493 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
494 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
495 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
497 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
499 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
501 fileName = "UpdateTC1444206.csar";
502 String filePath = FileHandling.getFilePath(folder); ;
504 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
506 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
507 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
508 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
511 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
512 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
514 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
515 String folder ="US825779";
516 String fileName = "ImportTC1444207.csar";
518 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
519 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
520 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
522 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
523 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
525 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
527 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
529 fileName = "UpdateTC1444207.csar";
530 String filePath = FileHandling.getFilePath(folder); ;
532 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
534 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
535 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
536 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
540 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
541 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
543 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
544 String folder ="US825779";
545 String fileName = "ImportTC1444208.csar";
547 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
548 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
549 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
550 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
552 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
554 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
556 fileName = "UpdateTC1444208.csar";
557 String filePath = FileHandling.getFilePath(folder); ;
559 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
561 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
562 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
563 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
566 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
567 // TC1444520 - Update Deployment Artifact With Name To Long
569 public void updateDeploymentArtifactWithNameToLong() throws Exception {
570 String folder ="US825779";
572 String fileName = "ImportTC1444520.csar";
574 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
576 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
578 fileName = "UpdateTC1444520.csar";
579 String filePath = FileHandling.getFilePath(folder); ;
581 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
583 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
584 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
585 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
588 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
589 // TC1444521 - Update Informational Artifact With Name To Long
591 public void updateInformationalArtifactWithNameToLong() throws Exception {
593 String folder = "US825779";
594 String fileName = "ImportTC1444521.csar";
596 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
598 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
600 fileName = "UpdateTC1444521.csar";
601 String filePath = FileHandling.getFilePath(folder); ;
603 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
605 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
606 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
607 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
610 // TODO: only after below TODO's it complete test
611 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
612 // TODO: in composition & artifact pages
613 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
614 // TC1444530 - Update Deployment Artifact With Invalid Type
616 public void updateDeploymentArtifactWithInvalidType() throws Exception {
617 String folder ="US825779";
618 String fileName = "ImportTC1444530.csar";
620 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
622 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
623 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
625 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
627 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
629 fileName = "UpdateTC1444530.csar";
630 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
632 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
636 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
637 // TC1444531 - Update Informational Artifact With Invalid Type
639 public void updateInformationalArtifactWithInvalidType() throws Exception {
640 String folder ="US825779";
641 String fileName = "ImportTC1444531.csar";
643 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
645 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
647 fileName = "UpdateTC1444531.csar";
649 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
650 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
652 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
657 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
658 String fileName = "ValidArtifactNameInInvalidFolder.csar";
659 String folder = "US824719";
661 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
662 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
663 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
665 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
669 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
670 String fileName = "ImportTC1444533.csar";
671 String folder = "US824719";
672 String filePath = FileHandling.getFilePath(folder);
673 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
674 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
676 String updatedCsarFileName = "UpdateTC1444533.csar";
678 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
679 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
680 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
682 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
688 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
690 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
694 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
695 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
696 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
697 String filePath = FileHandling.getFilePath(folder);
698 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
700 validateDeploymentArtifactPage(deploymentArtifacts, null);
701 validateInformationalArtifactPage(informationalArtifacts, null);
703 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
705 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
706 validateInformationalArtifactInComposition(informationalArtifacts, null);
711 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
712 String filePath = FileHandling.getFilePath(folder);
713 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
714 // Insert file to the browse dialog
715 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
716 browseWebElement.sendKeys(filePath + fileName);
718 // Fill the general page fields.
719 GeneralUIUtils.waitForLoader();
720 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
721 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
727 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
728 String filePath = FileHandling.getFilePath(folder);
729 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
730 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
732 validateDeploymentArtifactPage(deploymentArtifacts, null);
733 validateInformationalArtifactPage(informationalArtifacts, null);
735 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
737 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
738 validateInformationalArtifactInComposition(informationalArtifacts, null);
741 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
742 CompositionPage.showInformationArtifactTab();
743 // Composition informational
744 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
745 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
747 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
748 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
752 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
753 CompositionPage.showDeploymentArtifactTab();
754 // Composition deployment
755 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
756 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
758 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
759 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
763 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
764 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
765 // Informational page
766 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
767 validateEachArtifactInformationPage(informationalArtifacts);
769 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
770 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
774 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
775 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
777 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
778 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
780 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
781 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
785 // TODO: add validation that if not editable / deleteable then button should not appear
786 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
787 for(ArtifactInfo artifact: artifactInfoList) {
788 String type = artifact.getArtifactType();
789 String label = artifact.getArtifactLabel();
790 String version = artifact.getArtifactVersion();
792 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
793 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
796 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
801 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
802 for(ArtifactInfo artifact: artifactInfoList) {
803 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
807 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
808 for(ArtifactInfo artifact: artifactInfoList) {
809 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
813 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
814 for(ArtifactInfo artifact: artifactInfoList) {
815 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
819 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
820 for(ArtifactInfo artifact: artifactInfoList) {
822 String type = artifact.getArtifactType();
823 String label = artifact.getArtifactLabel();
824 String filename = artifact.getFilename();
826 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
827 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
830 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
835 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
836 for(ArtifactInfo artifact: artifactInfoList) {
837 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
841 // TODO: there is defect in this flow
842 // TODO: change isEditable to false when defect fix
843 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
844 for(ArtifactInfo artifact: artifactInfoList) {
845 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
849 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
850 for(ArtifactInfo artifact: artifactInfoList) {
851 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
858 protected UserRoleEnum getRole() {
859 return UserRoleEnum.DESIGNER;