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.onap.sdc.frontend.ci.tests.US;
23 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
24 import org.onap.sdc.frontend.ci.tests.datatypes.ArtifactInfo;
25 import org.onap.sdc.frontend.ci.tests.datatypes.CanvasElement;
26 import org.onap.sdc.frontend.ci.tests.datatypes.CanvasManager;
27 import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
28 import org.onap.sdc.backend.ci.tests.datatypes.ResourceReqDetails;
29 import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails;
30 import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
31 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
32 import org.onap.sdc.frontend.ci.tests.pages.InformationalArtifactPage;
33 import org.onap.sdc.frontend.ci.tests.pages.ResourceGeneralPage;
34 import org.onap.sdc.frontend.ci.tests.pages.UploadArtifactPopup;
35 import org.onap.sdc.frontend.ci.tests.utilities.ArtifactUIUtils;
36 import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
37 import org.onap.sdc.frontend.ci.tests.utilities.ResourceUIUtils;
38 import org.onap.sdc.frontend.ci.tests.utilities.ServiceUIUtils;
39 import org.onap.sdc.backend.ci.tests.utils.general.ElementFactory;
40 import org.testng.annotations.Test;
42 import java.util.ArrayList;
43 import java.util.List;
46 public class RemoveRestrictionOfDeploymentArtifacts extends SetupCDTest {
48 private String folder = "";
50 // US833330 - Story [BE] - remove restriction of deployment artifacts
51 // Create service without resource instance and without deployment artifacts and verify it can submit for testing
53 public void createServiceWithoutRIAndArtifacts() throws Exception {
54 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
55 ServiceUIUtils.createService(serviceMetadata);
56 //TODO Andrey should click on certify button
57 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
61 // US833330 - Story [BE] - remove restriction of deployment artifacts
62 // Create service with VL resource instance and without deployment artifacts and verify it can submit for testing
64 public void createServiceWithVlAndWithoutArtfiacts() throws Exception {
65 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
66 ServiceUIUtils.createService(serviceMetadata);
68 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
69 CanvasManager canvasManager = CanvasManager.getCanvasManager();
70 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
71 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
72 canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
74 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
77 // US833330 - Story [BE] - remove restriction of deployment artifacts
78 // Create service with VF with informational artifacts and verify it can submit for testing
80 public void createServiceWithInformationalArtifacts() throws Exception {
81 ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
82 ResourceUIUtils.createVF(resourceMetaData, getUser());
84 ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
86 String filePath = FileHandling.getFilePath(folder);
87 List<ArtifactInfo> informationalArtifactList = new ArrayList<ArtifactInfo>();
88 informationalArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
89 informationalArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "GUIDE"));
90 for (ArtifactInfo informationalArtifact : informationalArtifactList) {
91 InformationalArtifactPage.clickAddNewArtifact();
92 ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact, new UploadArtifactPopup(true));
94 //TODO Andrey should click on certify button
95 ResourceGeneralPage.clickCertifyButton(resourceMetaData.getName());
97 /*reloginWithNewRole(UserRoleEnum.TESTER);
98 GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
99 TesterOperationPage.certifyComponent(resourceMetaData.getName());
100 reloginWithNewRole(UserRoleEnum.DESIGNER);*/
102 ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
103 ServiceUIUtils.createService(serviceMetadata);
104 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
105 CanvasManager canvasManager = CanvasManager.getCanvasManager();
106 CanvasElement resourceInstance = canvasManager.createElementOnCanvas(resourceMetaData.getName());
108 ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
112 protected UserRoleEnum getRole() {
113 return UserRoleEnum.DESIGNER;