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