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.annotations.Test;
49 public class VfDeploymentInformationalArtifacts extends SetupCDTest {
52 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
54 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
56 // US824719 - Import VSP - VF informational artifacts
57 // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
59 public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
60 String fileName = "TC1434241.csar";
61 String folder ="US825779";
63 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
64 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
65 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
66 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
68 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
71 // US824719 - Import VSP - VF informational artifacts
72 // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
74 public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
75 String fileName = "TC1434245.csar";
76 String folder ="US825779";
78 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
79 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
80 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
82 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
83 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
84 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
86 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
87 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
89 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
92 // US824719 - Import VSP - VF informational artifacts
93 // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
95 public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
96 String fileName = "TC1434247.csar";
97 String folder ="US825779";
99 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
100 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
101 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
103 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
104 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
106 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
109 // US824719 - Import VSP - VF informational artifacts
110 // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
112 public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
113 String fileName = "TC1434248.csar";
114 String folder ="US825779";
116 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
117 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
118 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
120 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
121 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
122 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
123 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
125 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
128 // US824719 - Import VSP - VF informational artifacts
129 // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
131 public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
132 String fileName = "TC1434249.csar";
133 String folder ="US825779";
135 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
136 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
137 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
138 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
139 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
140 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
141 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
142 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
144 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
145 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
146 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
147 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
149 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
152 // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
153 // TODO: re-check it after defect fix
154 // US824719 - Import VSP - VF informational artifacts
155 // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
157 public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
158 String fileName = "DeploymentArtifactWithInvalidType.csar";
159 String folder ="US825779";
161 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
162 deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
163 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
164 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
166 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
169 // US824719 - Import VSP - VF informational artifacts
170 // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
172 public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
173 String fileName = "InformationArtifactWithInvalidType.csar";
174 String folder ="US825779";
176 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
177 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
178 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
180 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
181 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
183 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
186 // US824719 - Import VSP - VF informational artifacts
187 // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
189 public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
190 String folder = "US825779";
191 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
193 String fileName = "DeploymentArtifactWithLongName.csar";
195 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
197 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
198 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
199 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
202 // US824719 - Import VSP - VF informational artifacts
203 // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
204 // TODO: make informational artifact name longer then 255
205 // TODO: windows/linux not allowed it
207 public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
208 String folder ="US825779";
209 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
211 String fileName = "InformationArtifactWithLongName.csar";
213 importVfFromCsar(resourceMetaData, folder, fileName, getUser());
215 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
216 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
217 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
220 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
222 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
228 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
230 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
233 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
234 // TC1443736 - Update With One New Deployment Artifact
236 public void updateWithOneNewDeploymentArtifact() throws Exception {
237 String fileName = "ImportTC1443736.csar";
238 String folder ="US825779";
240 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
242 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
243 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
245 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
247 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
249 fileName = "UpdateTC1443736.csar";
250 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
252 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
256 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
257 // TC1443737 - Update With One Removed Deployment Artifact
259 public void updateWithOneRemovedDeploymentArtifact() throws Exception {
260 String fileName = "ImportTC1443737.csar";
261 String folder ="US825779";
263 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
265 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
266 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
267 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
268 deploymentArtifacts.add(artifactInfo);
270 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
272 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
274 fileName = "UpdateTC1443737.csar";
275 deploymentArtifacts.remove(artifactInfo);
277 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
278 deploymentArtifactsNotExist.add(artifactInfo);
280 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
283 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
284 // TC1443738 - Update With One New Version Deployment Artifact
286 public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
287 String fileName = "ImportTC1443738.csar";
288 String folder ="US825779";
290 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
292 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
293 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
294 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
295 deploymentArtifacts.add(artifactInfo);
298 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
300 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
302 fileName = "UpdateTC1443738.csar";
303 artifactInfo.setArtifactVersion("2");
305 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
308 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
309 // TC1443887 - Update With One New Informational Artifact
311 public void updateWithOneNewInformationalArtifact() throws Exception {
312 String fileName = "ImportTC1443887.csar";
313 String folder ="US825779";
315 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
316 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
317 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
319 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
321 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
323 fileName = "UpdateTC1443887.csar";
325 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
326 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
328 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
331 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
332 // TC1443888 - Update With One Removed Informational Artifact
334 public void updateWithOneRemovedInformationalArtifact() throws Exception {
335 String folder ="US825779";
336 String fileName = "ImportTC1443888.csar";
338 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
339 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
340 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
342 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
343 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
344 informationalArtifacts.add(artifactInfo);
346 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
348 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
350 fileName = "UpdateTC1443888.csar";
352 informationalArtifacts.remove(artifactInfo);
354 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
355 informationalArtifactNotExist.add(artifactInfo);
357 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
360 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
361 // TC1443890 - Update With One New Artifact Version Informational Artifact
363 public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
364 String folder ="US825779";
365 String fileName = "ImportTC1443890.csar";
367 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
368 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
369 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
371 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
372 ArtifactInfo artifactInfo = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
373 informationalArtifacts.add(artifactInfo);
375 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
377 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
379 fileName = "UpdateTC1443890.csar";
380 artifactInfo.setArtifactVersion("2");
382 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
385 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
386 // TC1443893 - Update CSAR With Same Artifacts As Imported
388 public void updateCSARWithSameArtifactsAsImported() throws Exception {
389 String folder ="US825779";
390 String fileName = "ImportUpdateTC1443893.csar";
392 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
393 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
394 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
395 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
396 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
397 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
398 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
399 deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
401 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
402 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
403 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
404 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
406 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
408 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
410 fileName = "ImportUpdateTC1443893.csar";
412 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
415 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
416 // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
418 public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
419 String folder ="US825779";
420 String fileName = "ImportTC1443954.csar";
422 ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
423 ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
424 ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
426 ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
427 ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
429 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
430 deploymentArtifacts.add(deploymentHeat1);
431 deploymentArtifacts.add(deploymentHeat2);
432 deploymentArtifacts.add(deploymentHeat3);
433 deploymentArtifacts.add(deploymentHeatVol1);
434 deploymentArtifacts.add(deploymentHeatVol2);
436 ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
437 ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
439 ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
440 ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
441 ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
443 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
444 informationalArtifacts.add(infoGuide1);
445 informationalArtifacts.add(infoGuide2);
446 informationalArtifacts.add(infoOther1);
447 informationalArtifacts.add(infoOther2);
448 informationalArtifacts.add(infoOther3);
450 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
452 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
454 fileName = "UpdateTC1443954.csar";
456 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
457 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
459 // Changes in deployment artifacts
460 deploymentArtifactsNotExist.add(deploymentHeat1);
461 deploymentArtifactsNotExist.add(deploymentHeat2);
462 deploymentArtifacts.remove(deploymentHeat1);
463 deploymentArtifacts.remove(deploymentHeat2);
464 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
465 deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
466 deploymentHeatVol1.setArtifactVersion("2");
467 deploymentHeatVol2.setArtifactVersion("2");
469 // Changes in informational artifacts
470 infoGuide1.setArtifactVersion("2");
471 infoOther1.setArtifactVersion("2");
472 informationalArtifactsNotExist.add(infoGuide2);
473 informationalArtifactsNotExist.add(infoOther2);
474 informationalArtifacts.remove(infoGuide2);
475 informationalArtifacts.remove(infoOther2);
476 informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
477 informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
479 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
483 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
484 // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
486 public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
487 String folder ="US825779";
488 String fileName = "ImportTC1444206.csar";
489 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
490 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
491 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
492 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
494 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
496 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
498 fileName = "UpdateTC1444206.csar";
499 String filePath = FileHandling.getFilePath(folder); ;
501 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
503 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
504 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
505 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
508 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
509 // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
511 public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
512 String folder ="US825779";
513 String fileName = "ImportTC1444207.csar";
515 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
516 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
517 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
519 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
520 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
522 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
524 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
526 fileName = "UpdateTC1444207.csar";
527 String filePath = FileHandling.getFilePath(folder); ;
529 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
531 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
532 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
533 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
537 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
538 // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
540 public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
541 String folder ="US825779";
542 String fileName = "ImportTC1444208.csar";
544 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
545 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
546 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
547 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
549 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
551 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
553 fileName = "UpdateTC1444208.csar";
554 String filePath = FileHandling.getFilePath(folder); ;
556 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
558 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
559 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
560 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
563 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
564 // TC1444520 - Update Deployment Artifact With Name To Long
566 public void updateDeploymentArtifactWithNameToLong() throws Exception {
567 String folder ="US825779";
569 String fileName = "ImportTC1444520.csar";
571 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
573 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
575 fileName = "UpdateTC1444520.csar";
576 String filePath = FileHandling.getFilePath(folder); ;
578 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
580 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
581 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
582 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
585 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
586 // TC1444521 - Update Informational Artifact With Name To Long
588 public void updateInformationalArtifactWithNameToLong() throws Exception {
590 String folder = "US825779";
591 String fileName = "ImportTC1444521.csar";
593 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
595 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
597 fileName = "UpdateTC1444521.csar";
598 String filePath = FileHandling.getFilePath(folder); ;
600 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
602 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
603 String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
604 Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
607 // TODO: only after below TODO's it complete test
608 // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
609 // TODO: in composition & artifact pages
610 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
611 // TC1444530 - Update Deployment Artifact With Invalid Type
613 public void updateDeploymentArtifactWithInvalidType() throws Exception {
615 String folder ="US825779";
616 String fileName = "ImportTC1444530.csar";
618 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
620 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
621 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
623 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
625 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
627 fileName = "UpdateTC1444530.csar";
628 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
630 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
634 // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
635 // TC1444531 - Update Informational Artifact With Invalid Type
637 public void updateInformationalArtifactWithInvalidType() throws Exception {
638 String folder ="US825779";
639 String fileName = "ImportTC1444531.csar";
641 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
643 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
645 fileName = "UpdateTC1444531.csar";
647 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
648 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
650 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
655 public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
656 String fileName = "ValidArtifactNameInInvalidFolder.csar";
657 String folder = "US824719";
659 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
660 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
661 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
663 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
667 public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
668 String fileName = "ImportTC1444533.csar";
669 String folder = "US824719";
670 String filePath = FileHandling.getFilePath(folder);
672 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
673 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
675 String updatedCsarFileName = "UpdateTC1444533.csar";
677 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
678 deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
679 deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
681 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
687 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
689 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
693 public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
694 List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
695 List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
696 String filePath = FileHandling.getFilePath(folder);
697 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
699 validateDeploymentArtifactPage(deploymentArtifacts, null);
700 validateInformationalArtifactPage(informationalArtifacts, null);
702 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
704 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
705 validateInformationalArtifactInComposition(informationalArtifacts, null);
710 public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
711 String filePath = FileHandling.getFilePath(folder);
712 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
713 // Insert file to the browse dialog
714 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
715 browseWebElement.sendKeys(filePath + fileName);
717 // Fill the general page fields.
718 GeneralUIUtils.waitForLoader();
719 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
720 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
726 public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
727 String filePath = FileHandling.getFilePath(folder);
728 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
729 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
731 validateDeploymentArtifactPage(deploymentArtifacts, null);
732 validateInformationalArtifactPage(informationalArtifacts, null);
734 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
736 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
737 validateInformationalArtifactInComposition(informationalArtifacts, null);
740 public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
741 CompositionPage.showInformationArtifactTab();
742 // Composition informational
743 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
744 validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
746 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
747 validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
751 public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
752 CompositionPage.showDeploymentArtifactTab();
753 // Composition deployment
754 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
755 validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
757 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
758 validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
762 public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
763 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
764 // Informational page
765 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
766 validateEachArtifactInformationPage(informationalArtifacts);
768 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
769 validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
773 public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
774 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
776 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
777 validateEachArtifactOnDeploymentPage(deploymentArtifacts);
779 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
780 validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
784 // TODO: add validation that if not editable / deleteable then button should not appear
785 public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
786 for(ArtifactInfo artifact: artifactInfoList) {
787 String type = artifact.getArtifactType();
788 String label = artifact.getArtifactLabel();
789 String version = artifact.getArtifactVersion();
791 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
792 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
795 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
800 public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
801 for(ArtifactInfo artifact: artifactInfoList) {
802 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
806 public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
807 for(ArtifactInfo artifact: artifactInfoList) {
808 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
812 public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
813 for(ArtifactInfo artifact: artifactInfoList) {
814 ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
818 public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
819 for(ArtifactInfo artifact: artifactInfoList) {
821 String type = artifact.getArtifactType();
822 String label = artifact.getArtifactLabel();
823 String filename = artifact.getFilename();
825 if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
826 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
829 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
834 public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
835 for(ArtifactInfo artifact: artifactInfoList) {
836 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
840 // TODO: there is defect in this flow
841 // TODO: change isEditable to false when defect fix
842 public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
843 for(ArtifactInfo artifact: artifactInfoList) {
844 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
848 public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
849 for(ArtifactInfo artifact: artifactInfoList) {
850 ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
857 protected UserRoleEnum getRole() {
858 return UserRoleEnum.DESIGNER;