ef8a3373946e2cf96cf0ae22f4d5fc2b7859edfc
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.ci.tests.execute.sanity;
22
23 import java.util.ArrayList;
24 import java.util.List;
25
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;
47
48
49 public class VfDeploymentInformationalArtifacts extends SetupCDTest {
50         
51         
52         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
53         // START US824719
54         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55         
56         // US824719 - Import VSP - VF informational artifacts
57         // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
58         @Test
59         public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
60                 String fileName = "TC1434241.csar";
61                 String folder ="US825779";
62                 
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"));
67                 
68                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
69         }
70         
71         // US824719 - Import VSP - VF informational artifacts
72         // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
73         @Test
74         public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
75                 String fileName = "TC1434245.csar";
76                 String folder ="US825779";
77                 
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"));
81                 
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"));
85                 
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"));
88                 
89                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
90         }
91         
92         // US824719 - Import VSP - VF informational artifacts
93         // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
94         @Test
95         public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
96                 String fileName = "TC1434247.csar";
97                 String folder ="US825779";
98                 
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"));
102                 
103                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
104                 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
105                 
106                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
107         }
108         
109         // US824719 - Import VSP - VF informational artifacts
110         // TC1434248 -  Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
111         @Test
112         public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
113                 String fileName = "TC1434248.csar";
114                 String folder ="US825779";
115                 
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"));
119                 
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"));
124                 
125                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,  folder, deploymentArtifacts, informationalArtifacts);
126         }
127         
128         // US824719 - Import VSP - VF informational artifacts
129         // TC1434249 -  Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
130         @Test
131         public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
132                 String fileName = "TC1434249.csar";
133                 String folder ="US825779";
134                 
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"));
143                 
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"));
148                 
149                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
150         }
151         
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
156         @Test
157         public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
158                 String fileName = "DeploymentArtifactWithInvalidType.csar";
159                 String folder ="US825779";
160                 
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"));
165                 
166                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
167         }
168         
169         // US824719 - Import VSP - VF informational artifacts
170         // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
171         @Test
172         public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
173                 String fileName = "InformationArtifactWithInvalidType.csar";
174                 String folder ="US825779";
175                 
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"));
179                 
180                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
181                 informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
182                 
183                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
184         }
185         
186         // US824719 - Import VSP - VF informational artifacts
187         // TC1438231 -  Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
188         @Test
189         public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {         
190                 String folder = "US825779";
191                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
192         
193                 String fileName = "DeploymentArtifactWithLongName.csar";
194                 
195                 importVfFromCsar(resourceMetaData, folder, fileName, getUser());        
196                 
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));
200         }
201         
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
206         @Test(enabled=false)
207         public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
208                 String folder ="US825779";
209                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
210         
211                 String fileName = "InformationArtifactWithLongName.csar";
212                 
213                 importVfFromCsar(resourceMetaData, folder, fileName, getUser());        
214                 
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));
218         }
219         
220         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
221         // END US824719
222         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
223         
224         
225         
226         
227         
228         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
229         // START US825779
230         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
231         
232         
233         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
234         // TC1443736 - Update With One New Deployment Artifact
235         @Test
236         public void updateWithOneNewDeploymentArtifact() throws Exception {
237                 String fileName =  "ImportTC1443736.csar";
238                 String folder ="US825779";
239                 
240                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
241                 
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"));
244                 
245                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
246                 
247                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
248                 
249                 fileName = "UpdateTC1443736.csar";
250                 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
251                 
252                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
253         }
254         
255         
256         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
257         // TC1443737 - Update With One Removed Deployment Artifact
258         @Test
259         public void updateWithOneRemovedDeploymentArtifact() throws Exception {
260                 String fileName =  "ImportTC1443737.csar";
261                 String folder ="US825779";
262                 
263                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
264                 
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);
269                 
270                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
271                 
272                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
273                 
274                 fileName = "UpdateTC1443737.csar";
275                 deploymentArtifacts.remove(artifactInfo);
276                 
277                 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
278                 deploymentArtifactsNotExist.add(artifactInfo);
279                 
280                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
281         }
282         
283         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
284         // TC1443738 - Update With One New Version Deployment Artifact
285         @Test
286         public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
287                 String fileName =  "ImportTC1443738.csar";
288                 String folder ="US825779";
289                         
290                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
291                         
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);
296                         
297                         
298                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
299                         
300                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
301                         
302                 fileName = "UpdateTC1443738.csar";
303                 artifactInfo.setArtifactVersion("2");
304                         
305                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
306         }
307         
308         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
309         // TC1443887 - Update With One New Informational Artifact
310         @Test
311         public void updateWithOneNewInformationalArtifact() throws Exception {
312                 String fileName =  "ImportTC1443887.csar";
313                 String folder ="US825779";
314                         
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"));                     
318                         
319                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
320                         
321                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
322                         
323                 fileName = "UpdateTC1443887.csar";
324                 
325                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
326                 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
327                         
328                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
329         }
330         
331         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
332         // TC1443888 - Update With One Removed Informational Artifact
333         @Test
334         public void updateWithOneRemovedInformationalArtifact() throws Exception {
335                 String folder ="US825779";
336                 String fileName =  "ImportTC1443888.csar";
337                         
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"));                     
341                 
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);
345                         
346                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
347                 
348                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
349                         
350                 fileName = "UpdateTC1443888.csar";
351                 
352                 informationalArtifacts.remove(artifactInfo);
353                 
354                 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
355                 informationalArtifactNotExist.add(artifactInfo);
356                         
357                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
358         }
359         
360         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
361         // TC1443890 - Update With One New Artifact Version Informational Artifact
362         @Test
363         public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
364                 String folder ="US825779";
365                 String fileName =  "ImportTC1443890.csar";
366                         
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"));                     
370                 
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);
374                         
375                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
376                 
377                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
378                         
379                 fileName = "UpdateTC1443890.csar";
380                 artifactInfo.setArtifactVersion("2");
381                         
382                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
383         }
384         
385         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
386         // TC1443893 - Update CSAR With Same Artifacts As Imported
387         @Test
388         public void updateCSARWithSameArtifactsAsImported() throws Exception {          
389                 String folder ="US825779";
390                 String fileName =  "ImportUpdateTC1443893.csar";
391                         
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"));
400                 
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"));
405                         
406                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
407                 
408                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
409                         
410                 fileName = "ImportUpdateTC1443893.csar";
411                         
412                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
413         }
414         
415         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
416         // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
417         @Test
418         public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
419                 String folder ="US825779";
420                 String fileName =  "ImportTC1443954.csar";
421                 
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");
425                 
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");
428                 
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);
435                 
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");
438                 
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");
442                 
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);
449                         
450                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
451                 
452                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
453                         
454                 fileName = "UpdateTC1443954.csar";
455                 
456                 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
457                 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
458                 
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");
468                 
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"));
478                         
479                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
480         }
481         
482         
483         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
484         // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
485         @Test
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"));
493                         
494                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
495                 
496                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
497                         
498                 fileName = "UpdateTC1444206.csar";
499                 String filePath = FileHandling.getFilePath(folder); ;
500                         
501                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
502                 
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));
506         }
507         
508         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
509         // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
510         @Test
511         public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
512                 String folder ="US825779";
513                 String fileName =  "ImportTC1444207.csar";
514                         
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"));             
518                 
519                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
520                 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
521                         
522                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
523                 
524                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
525                 
526                 fileName = "UpdateTC1444207.csar";
527                 String filePath = FileHandling.getFilePath(folder); ;
528                         
529                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
530                 
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));
534         }
535         
536         
537         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
538         // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
539         @Test
540         public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {            
541                 String folder ="US825779";
542                 String fileName =  "ImportTC1444208.csar";
543                         
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"));
548                         
549                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
550                 
551                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
552                 
553                 fileName = "UpdateTC1444208.csar";
554                 String filePath = FileHandling.getFilePath(folder); ;
555                                 
556                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
557                 
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));
561         }
562         
563         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
564         // TC1444520 - Update Deployment Artifact With Name To Long
565         @Test
566         public void updateDeploymentArtifactWithNameToLong() throws Exception {
567                 String folder ="US825779";
568                 
569                 String fileName =  "ImportTC1444520.csar";
570                         
571                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
572                 
573                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
574                 
575                 fileName = "UpdateTC1444520.csar";
576                 String filePath = FileHandling.getFilePath(folder); ;
577                                 
578                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
579                 
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));
583         }
584         
585         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
586         // TC1444521 - Update Informational Artifact With Name To Long
587         @Test
588         public void updateInformationalArtifactWithNameToLong() throws Exception {
589                 
590                 String folder = "US825779";
591                 String fileName =  "ImportTC1444521.csar";
592                         
593                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
594                 
595                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
596                 
597                 fileName = "UpdateTC1444521.csar";
598                 String filePath = FileHandling.getFilePath(folder); ;
599                                 
600                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
601                 
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));
605         }
606         
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
612         @Test
613         public void updateDeploymentArtifactWithInvalidType() throws Exception {
614
615                 String folder ="US825779";
616                 String fileName =  "ImportTC1444530.csar";
617                 
618                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
619                 
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"));
622                 
623                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
624                 
625                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
626                 
627                 fileName = "UpdateTC1444530.csar";
628                 deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
629                 
630                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
631         }
632         
633         
634         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
635         // TC1444531 - Update Informational Artifact With Invalid Type
636         @Test
637         public void updateInformationalArtifactWithInvalidType() throws Exception {             
638                 String folder ="US825779";
639                 String fileName =  "ImportTC1444531.csar";
640                 
641                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
642                 
643                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
644                 
645                 fileName = "UpdateTC1444531.csar";
646                 
647                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
648                 informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
649                 
650                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
651         }
652         
653         
654         @Test
655         public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
656                 String fileName =  "ValidArtifactNameInInvalidFolder.csar";
657                 String folder = "US824719";
658                 
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"));                     
662                 
663                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
664         }
665         
666         @Test
667         public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
668                 String fileName =  "ImportTC1444533.csar";
669                 String folder = "US824719";
670                 String filePath = FileHandling.getFilePath(folder);
671                 
672                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
673                 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
674                 
675                 String updatedCsarFileName = "UpdateTC1444533.csar";
676                 
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"));                     
680                 
681                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
682         }
683         
684         
685         
686         
687         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
688         // END US825779
689         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
690         
691         
692         
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);
698                 
699                 validateDeploymentArtifactPage(deploymentArtifacts, null);
700                 validateInformationalArtifactPage(informationalArtifacts, null);
701                 
702                 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
703                 
704                 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
705                 validateInformationalArtifactInComposition(informationalArtifacts, null);
706                 
707         }
708         
709
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);
716
717                 // Fill the general page fields.
718                 GeneralUIUtils.waitForLoader();
719                 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
720                 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
721         }
722
723         
724         
725         
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());
730                 
731                 validateDeploymentArtifactPage(deploymentArtifacts, null);
732                 validateInformationalArtifactPage(informationalArtifacts, null);
733                 
734                 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
735                 
736                 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
737                 validateInformationalArtifactInComposition(informationalArtifacts, null);
738         }
739         
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);
745                 }
746                 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
747                         validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
748                 }
749         }
750         
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);
756                 }
757                 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
758                         validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
759                 }
760         }
761         
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);
767                 }
768                 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {       
769                         validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
770                 }
771         }
772         
773         public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
774                 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
775                 // Deployment page
776                 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
777                         validateEachArtifactOnDeploymentPage(deploymentArtifacts);
778                 }
779                 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
780                         validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
781                 }
782         }
783         
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();
790                         
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);
793                         }
794                         else{
795                                 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
796                         }
797                 }
798         }
799         
800         public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
801                 for(ArtifactInfo artifact: artifactInfoList) {
802                         ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
803                 }
804         }
805         
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);
809                 }
810         }
811         
812         public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
813                 for(ArtifactInfo artifact: artifactInfoList) {
814                         ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
815                 }
816         }
817         
818         public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
819                 for(ArtifactInfo artifact: artifactInfoList) {
820                         
821                         String type = artifact.getArtifactType();
822                         String label = artifact.getArtifactLabel();
823                         String filename = artifact.getFilename();
824                         
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);
827                         }
828                         else{
829                                 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
830                         }
831                 }
832         }
833         
834         public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
835                 for(ArtifactInfo artifact: artifactInfoList) {
836                         ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
837                 }
838         }
839         
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);
845                 }
846         }
847         
848         public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
849                 for(ArtifactInfo artifact: artifactInfoList) {
850                         ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
851                 }
852         }
853
854
855
856         @Override
857         protected UserRoleEnum getRole() {
858                 return UserRoleEnum.DESIGNER;
859         }
860
861 }