[sdc] update code of sdc
[sdc.git] / ui-ci / src / main / java / org / openecomp / sdc / ci / tests / execute / sanity / VfDeploymentInformationalArtifacts.java
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.SkipException;
47 import org.testng.annotations.Test;
48
49
50 public class VfDeploymentInformationalArtifacts extends SetupCDTest {
51         
52         
53         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
54         // START US824719
55         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
56         
57         // US824719 - Import VSP - VF informational artifacts
58         // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
59         @Test
60         public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
61                 String fileName = "TC1434241.csar";
62                 String folder ="US825779";
63                 
64                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
65                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
66                 
67                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
68                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
69                 
70                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
71         }
72         
73         // US824719 - Import VSP - VF informational artifacts
74         // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
75         @Test
76         public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
77                 String fileName = "TC1434245.csar";
78                 String folder ="US825779";
79                 
80                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
81                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
82                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
83                 
84                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
85                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
86                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
87                 
88                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
89                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
90                 
91                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,folder, deploymentArtifacts, null);
92         }
93         
94         // US824719 - Import VSP - VF informational artifacts
95         // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
96         @Test
97         public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
98                 
99                 if(true){
100                         throw new SkipException("Open bug 299719");                     
101                 }
102                 
103                 String fileName = "TC1434247.csar";
104                 String folder ="US825779";
105                 
106                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
107                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
108                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
109                 
110                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
111                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
112                 
113                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
114         }
115         
116         // US824719 - Import VSP - VF informational artifacts
117         // TC1434248 -  Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
118         @Test
119         public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
120                 
121                 if(true){
122                         throw new SkipException("Open bug 299719");                     
123                 }
124                 
125                 String fileName = "TC1434248.csar";
126                 String folder ="US825779";
127                 
128                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
129                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
130                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
131                 
132                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
133                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
134                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
135                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
136                 
137                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName,  folder, deploymentArtifacts, informationalArtifacts);
138         }
139         
140         // US824719 - Import VSP - VF informational artifacts
141         // TC1434249 -  Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
142         @Test
143         public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
144                 
145                 if(true){
146                         throw new SkipException("Open bug 299719");                     
147                 }
148                 
149                 String fileName = "TC1434249.csar";
150                 String folder ="US825779";
151                 
152                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
153                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
154                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
155                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
156                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
157                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
158                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
159                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
160                 
161                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
162                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
163                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
164                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
165                 
166                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
167         }
168         
169         // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
170         // TODO: re-check it after defect fix
171         // US824719 - Import VSP - VF informational artifacts
172         // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
173         @Test
174         public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
175                 
176                 if(true){
177                         throw new SkipException("Open bug 299719");                     
178                 }
179                 
180                 String fileName = "DeploymentArtifactWithInvalidType.csar";
181                 String folder ="US825779";
182                 
183                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
184                 deploymentArtifacts.add(new  ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
185                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
186                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
187                 
188                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
189         }
190         
191         // US824719 - Import VSP - VF informational artifacts
192         // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
193         @Test
194         public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
195                 
196                 if(true){
197                         throw new SkipException("Open bug 299719");                     
198                 }
199                 
200                 String fileName = "InformationArtifactWithInvalidType.csar";
201                 String folder ="US825779";
202                 
203                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
204                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
205                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
206                 
207                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
208                 informationalArtifacts.add(new  ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
209                 
210                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
211         }
212         
213         // US824719 - Import VSP - VF informational artifacts
214         // TC1438231 -  Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
215         @Test
216         public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {         
217                 String folder = "US825779";
218                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
219         
220                 String fileName = "DeploymentArtifactWithLongName.csar";
221                 
222                 importVfFromCsar(resourceMetaData, folder, fileName, getUser());        
223                 
224                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
225         String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
226         Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
227         }
228         
229         // US824719 - Import VSP - VF informational artifacts
230         // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
231         // TODO: make informational artifact name longer then 255
232         // TODO: windows/linux not allowed it
233         @Test(enabled=false)
234         public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
235                 String folder ="US825779";
236                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
237         
238                 String fileName = "InformationArtifactWithLongName.csar";
239                 
240                 importVfFromCsar(resourceMetaData, folder, fileName, getUser());        
241                 
242                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
243             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
244             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
245         }
246         
247         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
248         // END US824719
249         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
250         
251         
252         
253         
254         
255         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
256         // START US825779
257         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
258         
259         
260         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
261         // TC1443736 - Update With One New Deployment Artifact
262         @Test
263         public void updateWithOneNewDeploymentArtifact() throws Exception {
264                 String fileName =  "ImportTC1443736.csar";
265                 String folder ="US825779";
266                 
267                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
268                 
269                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
270                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
271                 
272                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
273                 
274                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
275                 
276                 fileName = "UpdateTC1443736.csar";
277                 deploymentArtifacts.add(new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
278                 
279                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
280         }
281         
282         
283         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
284         // TC1443737 - Update With One Removed Deployment Artifact
285         @Test
286         public void updateWithOneRemovedDeploymentArtifact() throws Exception {
287                 String fileName =  "ImportTC1443737.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(), "1"));
293                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
294                 ArtifactInfo artifactInfo = new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
295                 deploymentArtifacts.add(artifactInfo);
296                 
297                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
298                 
299                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
300                 
301                 fileName = "UpdateTC1443737.csar";
302                 deploymentArtifacts.remove(artifactInfo);
303                 
304                 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
305                 deploymentArtifactsNotExist.add(artifactInfo);
306                 
307                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, deploymentArtifactsNotExist, null);
308         }
309         
310         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
311         // TC1443738 - Update With One New Version Deployment Artifact
312         @Test
313         public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
314                 String fileName =  "ImportTC1443738.csar";
315                 String folder ="US825779";
316                         
317                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
318                         
319                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
320                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
321                 ArtifactInfo artifactInfo = new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
322                 deploymentArtifacts.add(artifactInfo);
323                         
324                         
325                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
326                         
327                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
328                         
329                 fileName = "UpdateTC1443738.csar";
330                 artifactInfo.setArtifactVersion("2");
331                         
332                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
333         }
334         
335         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
336         // TC1443887 - Update With One New Informational Artifact
337         @Test
338         public void updateWithOneNewInformationalArtifact() throws Exception {
339                 
340                 if(true){
341                         throw new SkipException("Open bug 299719");                     
342                 }
343                 
344                 String fileName =  "ImportTC1443887.csar";
345                 String folder ="US825779";
346                         
347                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
348                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
349                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
350                         
351                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
352                         
353                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
354                         
355                 fileName = "UpdateTC1443887.csar";
356                 
357                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
358                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
359                         
360                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
361         }
362         
363         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
364         // TC1443888 - Update With One Removed Informational Artifact
365         @Test
366         public void updateWithOneRemovedInformationalArtifact() throws Exception {
367                 
368                 if(true){
369                         throw new SkipException("Open bug 299719");                     
370                 }
371                 
372                 String folder ="US825779";
373                 String fileName =  "ImportTC1443888.csar";
374                         
375                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
376                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
377                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
378                 
379                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
380                 ArtifactInfo artifactInfo = new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
381                 informationalArtifacts.add(artifactInfo);
382                         
383                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
384                 
385                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
386                         
387                 fileName = "UpdateTC1443888.csar";
388                 
389                 informationalArtifacts.remove(artifactInfo);
390                 
391                 List<ArtifactInfo> informationalArtifactNotExist = new ArrayList<ArtifactInfo>();
392                 informationalArtifactNotExist.add(artifactInfo);
393                         
394                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, informationalArtifactNotExist);
395         }
396         
397         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
398         // TC1443890 - Update With One New Artifact Version Informational Artifact
399         @Test
400         public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
401                 
402                 if(true){
403                         throw new SkipException("Open bug 299719");                     
404                 }
405                 
406                 String folder ="US825779";
407                 String fileName =  "ImportTC1443890.csar";
408                         
409                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
410                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
411                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
412                 
413                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
414                 ArtifactInfo artifactInfo = new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
415                 informationalArtifacts.add(artifactInfo);
416                         
417                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
418                 
419                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
420                         
421                 fileName = "UpdateTC1443890.csar";
422                 artifactInfo.setArtifactVersion("2");
423                         
424                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
425         }
426         
427         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
428         // TC1443893 - Update CSAR With Same Artifacts As Imported
429         @Test
430         public void updateCSARWithSameArtifactsAsImported() throws Exception {
431                 
432                 if(true){
433                         throw new SkipException("Open bug 299719");                     
434                 }
435                 
436                 String folder ="US825779";
437                 String fileName =  "ImportUpdateTC1443893.csar";
438                         
439                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
440                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
441                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
442                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
443                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));    
444                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
445                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
446                 deploymentArtifacts.add(new  ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
447                 
448                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
449                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
450                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
451                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
452                         
453                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
454                 
455                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
456                         
457                 fileName = "ImportUpdateTC1443893.csar";
458                         
459                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, null, null);
460         }
461         
462         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
463         // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
464         @Test
465         public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
466                 
467                 if(true){
468                         throw new SkipException("Open bug 299719");                     
469                 }
470                 
471                 String folder ="US825779";
472                 String fileName =  "ImportTC1443954.csar";
473                 
474                 ArtifactInfo deploymentHeat1 = new  ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
475                 ArtifactInfo deploymentHeat2 = new  ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
476                 ArtifactInfo deploymentHeat3 = new  ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
477                 
478                 ArtifactInfo deploymentHeatVol1 = new  ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
479                 ArtifactInfo deploymentHeatVol2 = new  ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
480                 
481                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
482                 deploymentArtifacts.add(deploymentHeat1);
483                 deploymentArtifacts.add(deploymentHeat2);
484                 deploymentArtifacts.add(deploymentHeat3);
485                 deploymentArtifacts.add(deploymentHeatVol1);
486                 deploymentArtifacts.add(deploymentHeatVol2);
487                 
488                 ArtifactInfo infoGuide1 = new  ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
489                 ArtifactInfo infoGuide2 = new  ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
490                 
491                 ArtifactInfo infoOther1 = new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
492                 ArtifactInfo infoOther2 = new  ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
493                 ArtifactInfo infoOther3 = new  ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
494                 
495                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
496                 informationalArtifacts.add(infoGuide1);
497                 informationalArtifacts.add(infoGuide2);
498                 informationalArtifacts.add(infoOther1);
499                 informationalArtifacts.add(infoOther2);
500                 informationalArtifacts.add(infoOther3);
501                         
502                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
503                 
504                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
505                         
506                 fileName = "UpdateTC1443954.csar";
507                 
508                 List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
509                 List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
510                 
511                 // Changes in deployment artifacts
512                 deploymentArtifactsNotExist.add(deploymentHeat1);
513                 deploymentArtifactsNotExist.add(deploymentHeat2);
514                 deploymentArtifacts.remove(deploymentHeat1);
515                 deploymentArtifacts.remove(deploymentHeat2);
516                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
517                 deploymentArtifacts.add(new  ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
518                 deploymentHeatVol1.setArtifactVersion("2");
519                 deploymentHeatVol2.setArtifactVersion("2");
520                 
521                 // Changes in informational artifacts
522                 infoGuide1.setArtifactVersion("2");
523                 infoOther1.setArtifactVersion("2");
524                 informationalArtifactsNotExist.add(infoGuide2);
525                 informationalArtifactsNotExist.add(infoOther2);
526                 informationalArtifacts.remove(infoGuide2);
527                 informationalArtifacts.remove(infoOther2);
528                 informationalArtifacts.add(new  ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
529                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
530                         
531                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
532         }
533         
534         
535         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
536         // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
537         @Test
538         public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
539                 String folder ="US825779";
540                 String fileName =  "ImportTC1444206.csar";
541                         
542                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
543                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
544                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
545                 deploymentArtifacts.add(new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
546                         
547                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
548                 
549                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
550                         
551                 fileName = "UpdateTC1444206.csar";
552                 String filePath = FileHandling.getFilePath(folder); ;
553                         
554                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
555                 
556                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
557             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
558             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
559         }
560         
561         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
562         // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
563         @Test
564         public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
565                 
566                 if(true){
567                         throw new SkipException("Open bug 299719");                     
568                 }
569                 
570                 String folder ="US825779";
571                 String fileName =  "ImportTC1444207.csar";
572                         
573                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
574                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
575                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));            
576                 
577                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
578                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
579                         
580                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, informationalArtifacts);
581                 
582                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
583                 
584                 fileName = "UpdateTC1444207.csar";
585                 String filePath = FileHandling.getFilePath(folder); ;
586                         
587                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
588                 
589                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
590             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
591             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
592         }
593         
594         
595         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
596         // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
597         @Test
598         public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
599                 String folder ="US825779";
600                 String fileName =  "ImportTC1444208.csar";
601                         
602                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
603                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
604                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));            
605                 deploymentArtifacts.add(new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
606                         
607                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
608                 
609                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
610                 
611                 fileName = "UpdateTC1444208.csar";
612                 String filePath = FileHandling.getFilePath(folder); ;
613                                 
614                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
615                 
616                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
617             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR.name());
618             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
619         }
620         
621         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
622         // TC1444520 - Update Deployment Artifact With Name To Long
623         @Test
624         public void updateDeploymentArtifactWithNameToLong() throws Exception {
625                 String folder ="US825779";
626                 
627                 String fileName =  "ImportTC1444520.csar";
628                         
629                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
630                 
631                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
632                 
633                 fileName = "UpdateTC1444520.csar";
634                 String filePath = FileHandling.getFilePath(folder); ;
635                                 
636                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
637                 
638                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
639             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
640             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
641         }
642         
643         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
644         // TC1444521 - Update Informational Artifact With Name To Long
645         @Test
646         public void updateInformationalArtifactWithNameToLong() throws Exception {
647                 
648                 String folder = "US825779";
649                 String fileName =  "ImportTC1444521.csar";
650                         
651                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
652                 
653                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
654                 
655                 fileName = "UpdateTC1444521.csar";
656                 String filePath = FileHandling.getFilePath(folder); ;
657                                 
658                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
659                 
660                 String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
661             String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
662             Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
663         }
664         
665         // TODO: only after below TODO's it complete test
666         // TODO: verify that if delete/edit button need to be disabled then check that there is no such buttons
667         // TODO: in composition & artifact pages
668         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
669         // TC1444530 - Update Deployment Artifact With Invalid Type
670         @Test
671         public void updateDeploymentArtifactWithInvalidType() throws Exception {
672                 
673                 if(true){
674                         throw new SkipException("Open bug 299719");                     
675                 }
676                 
677                 String folder ="US825779";
678                 String fileName =  "ImportTC1444530.csar";
679                 
680                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
681                 
682                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
683                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
684                 
685                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
686                 
687                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
688                 
689                 fileName = "UpdateTC1444530.csar";
690                 deploymentArtifacts.add(new  ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
691                 
692                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, null, null, null);
693         }
694         
695         
696         // US825779 - Story: [BE] Import VSP - VF informational artifacts  - Update
697         // TC1444531 - Update Informational Artifact With Invalid Type
698         @Test
699         public void updateInformationalArtifactWithInvalidType() throws Exception {
700                 
701                 if(true){
702                         throw new SkipException("Open bug 299719");                     
703                 }
704                 
705                 String folder ="US825779";
706                 String fileName =  "ImportTC1444531.csar";
707                 
708                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  null, null);
709                 
710                 GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
711                 
712                 fileName = "UpdateTC1444531.csar";
713                 
714                 List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
715                 informationalArtifacts.add(new  ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
716                 
717                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
718         }
719         
720         
721         @Test
722         public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception{
723                 String fileName =  "ValidArtifactNameInInvalidFolder.csar";
724                 String folder = "US824719";
725                 
726                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
727                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
728                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
729                 
730                 importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder,  deploymentArtifacts, null);
731         }
732         
733         @Test
734         public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception{
735                 String fileName =  "ImportTC1444533.csar";
736                 String folder = "US824719";
737                 String filePath = FileHandling.getFilePath(folder);
738                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
739                 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
740                 
741                 String updatedCsarFileName = "UpdateTC1444533.csar";
742                 
743                 List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
744                 deploymentArtifacts.add(new  ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
745                 deploymentArtifacts.add(new  ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));                    
746                 
747                 updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
748         }
749         
750         
751         
752         
753         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
754         // END US825779
755         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
756         
757         
758         
759         public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
760                         List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
761                         List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
762                 String filePath = FileHandling.getFilePath(folder);
763                 ResourceUIUtils.updateVfWithCsar(filePath, fileName);
764                 
765                 validateDeploymentArtifactPage(deploymentArtifacts, null);
766                 validateInformationalArtifactPage(informationalArtifacts, null);
767                 
768                 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
769                 
770                 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
771                 validateInformationalArtifactInComposition(informationalArtifacts, null);
772                 
773         }
774         
775
776         public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
777                 String filePath = FileHandling.getFilePath(folder);
778                 GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
779                 // Insert file to the browse dialog
780                 WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
781                 browseWebElement.sendKeys(filePath + fileName);
782
783                 // Fill the general page fields.
784                 GeneralUIUtils.waitForLoader();
785                 ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
786                 GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
787         }
788
789         
790         
791         
792         public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
793                 String filePath = FileHandling.getFilePath(folder);
794                 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
795                 ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
796                 
797                 validateDeploymentArtifactPage(deploymentArtifacts, null);
798                 validateInformationalArtifactPage(informationalArtifacts, null);
799                 
800                 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
801                 
802                 validateDeploymentArtifactInComposition(deploymentArtifacts, null);
803                 validateInformationalArtifactInComposition(informationalArtifacts, null);
804         }
805         
806         public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
807                 CompositionPage.showInformationArtifactTab();
808                 // Composition informational
809                 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {
810                         validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
811                 }
812                 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
813                         validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
814                 }
815         }
816         
817         public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
818                 CompositionPage.showDeploymentArtifactTab();
819                 // Composition deployment
820                 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
821                         validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
822                 }
823                 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
824                         validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
825                 }
826         }
827         
828         public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
829                 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
830                 // Informational page
831                 if(informationalArtifacts != null && informationalArtifacts.size() > 0) {       
832                         validateEachArtifactInformationPage(informationalArtifacts);
833                 }
834                 if(informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {       
835                         validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
836                 }
837         }
838         
839         public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
840                 ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
841                 // Deployment page
842                 if(deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
843                         validateEachArtifactOnDeploymentPage(deploymentArtifacts);
844                 }
845                 if(deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
846                         validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
847                 }
848         }
849         
850         // TODO: add validation that if not editable / deleteable then button should not appear
851         public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
852                 for(ArtifactInfo artifact: artifactInfoList) {
853                         String type = artifact.getArtifactType();
854                         String label = artifact.getArtifactLabel();
855                         String version = artifact.getArtifactVersion();
856                         
857                         if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
858                                 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
859                         }
860                         else{
861                                 ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
862                         }
863                 }
864         }
865         
866         public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
867                 for(ArtifactInfo artifact: artifactInfoList) {
868                         ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
869                 }
870         }
871         
872         public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
873                 for(ArtifactInfo artifact: artifactInfoList) {
874                         ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
875                 }
876         }
877         
878         public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
879                 for(ArtifactInfo artifact: artifactInfoList) {
880                         ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
881                 }
882         }
883         
884         public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
885                 for(ArtifactInfo artifact: artifactInfoList) {
886                         
887                         String type = artifact.getArtifactType();
888                         String label = artifact.getArtifactLabel();
889                         String filename = artifact.getFilename();
890                         
891                         if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
892                                 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
893                         }
894                         else{
895                                 ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
896                         }
897                 }
898         }
899         
900         public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
901                 for(ArtifactInfo artifact: artifactInfoList) {
902                         ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
903                 }
904         }
905         
906         // TODO: there is defect in this flow
907         // TODO: change isEditable to false when defect fix
908         public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
909                 for(ArtifactInfo artifact: artifactInfoList) {
910                         ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
911                 }
912         }
913         
914         public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
915                 for(ArtifactInfo artifact: artifactInfoList) {
916                         ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
917                 }
918         }
919
920
921
922         @Override
923         protected UserRoleEnum getRole() {
924                 return UserRoleEnum.DESIGNER;
925         }
926
927 }