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