2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.US;
23 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
24 import org.openecomp.sdc.ci.tests.datatypes.*;
25 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
26 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
27 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
28 import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
29 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
30 import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
31 import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
32 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
33 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
34 import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
35 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
36 import org.testng.annotations.Test;
38 import java.util.ArrayList;
39 import java.util.List;
42 public class RemoveRestrictionOfDeploymentArtifacts extends SetupCDTest {
44 private String folder ="";
46 // US833330 - Story [BE] - remove restriction of deployment artifacts
47 // Create service without resource instance and without deployment artifacts and verify it can submit for testing
49 public void createServiceWithoutRIAndArtifacts() throws Exception {
50 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
51 ServiceUIUtils.createService(serviceMetadata, getUser());
52 //TODO Andrey should click on certify button
53 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
57 // US833330 - Story [BE] - remove restriction of deployment artifacts
58 // Create service with VL resource instance and without deployment artifacts and verify it can submit for testing
60 public void createServiceWithVlAndWithoutArtfiacts() throws Exception {
61 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
62 ServiceUIUtils.createService(serviceMetadata, getUser());
64 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
65 CanvasManager canvasManager = CanvasManager.getCanvasManager();
66 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
67 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
68 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
70 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
73 // US833330 - Story [BE] - remove restriction of deployment artifacts
74 // Create service with VF with informational artifacts and verify it can submit for testing
76 public void createServiceWithInformationalArtifacts() throws Exception {
77 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
78 ResourceUIUtils.createVF(resourceMetaData, getUser());
80 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
82 String filePath = FileHandling.getFilePath(folder);
83 List<ArtifactInfo> informationalArtifactList = new ArrayList<ArtifactInfo>();
84 informationalArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
85 informationalArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "GUIDE"));
86 for (ArtifactInfo informationalArtifact : informationalArtifactList) {
87 InformationalArtifactPage.clickAddNewArtifact();
88 ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact, new UploadArtifactPopup(true));
90 //TODO Andrey should click on certify button
91 ResourceGeneralPage.clickCertifyButton(resourceMetaData.getName());
93 /*reloginWithNewRole(UserRoleEnum.TESTER);
94 GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
95 TesterOperationPage.certifyComponent(resourceMetaData.getName());
96 reloginWithNewRole(UserRoleEnum.DESIGNER);*/
98 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
99 ServiceUIUtils.createService(serviceMetadata, getUser());
100 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
101 CanvasManager canvasManager = CanvasManager.getCanvasManager();
102 CanvasElement resourceInstance = canvasManager.createElementOnCanvas(resourceMetaData.getName());
104 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
108 protected UserRoleEnum getRole() {
109 return UserRoleEnum.DESIGNER;