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 java.awt.AWTException;
25 import java.util.ArrayList;
26 import java.util.HashMap;
27 import java.util.List;
30 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
31 import org.openecomp.sdc.ci.tests.config.Config;
32 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
33 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ArtifactPageEnum;
34 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
35 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
36 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
37 import org.openecomp.sdc.ci.tests.execute.sanity.Onboard;
38 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
39 import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
40 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
41 import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
42 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
43 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
44 import org.openecomp.sdc.ci.tests.utilities.OnboardingUtils;
45 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
46 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
47 import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
48 import org.openqa.selenium.WebElement;
49 import org.testng.Assert;
50 import org.testng.annotations.Test;
52 public class Vf_Tests_UI extends SetupCDTest{
54 public Vf_Tests_UI() {
55 // TODO Auto-generated constructor stub
57 public void uploadHeatEnvVFLevel() throws Exception {
59 ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
60 ResourceUIUtils.createResource(vfMetaData, getUser());
65 // // Download ENV file from VF level.
66 // public void downloadEnvVFLevel() throws AWTException, Exception {
67 // String firstEnvArtifact = "base_stsi_dnt_frwl.env";
68 // String secondEnvArtifact = "mod_vmsi_dnt_fw_parent.env";
69 // String filePath=Config.instance().getWindowsDownloadDirectory();
70 // String vnfFile = "FDNT.zip";
71 // OnboardingUtils.onboardAndValidate(Onboard.getFilePath(), vnfFile, getUser());
72 // Map<String,File> mD5OfFilesToValidate = new HashMap<String,File>();
73 // mD5OfFilesToValidate.put(firstEnvArtifact,new File(FileHandling.getResourcesEnvFilesPath() + firstEnvArtifact));
74 // mD5OfFilesToValidate.put(secondEnvArtifact,new File(FileHandling.getResourcesEnvFilesPath() + secondEnvArtifact));
75 // List<File>filesToBeDeleted=new ArrayList<>(mD5OfFilesToValidate.values());
76 // FileHandling.deleteLastDowloadedFiles(filesToBeDeleted);
77 // ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
78 // List<WebElement> allDisplayedArtifcats = DeploymentArtifactPage.getDeploymentArtifactsNamesWorkSpace();
79 // for (int i=0;i<allDisplayedArtifcats.size();i++) {
80 // if (DeploymentArtifactPage.geteArtifactType(allDisplayedArtifcats.get(i).getText()).equalsIgnoreCase("heat")) {
81 // DeploymentArtifactPage.clickDownloadEnvArtifact(allDisplayedArtifcats.get(i));
82 // GeneralUIUtils.waitForLoader();
83 // File latestFilefromDir = FileHandling.getRequiredFromDir(filePath,allDisplayedArtifcats.get(i).getText()+".env");
84 // VfVerificator.verifyFilesChecksum(latestFilefromDir,mD5OfFilesToValidate.get(latestFilefromDir.getName()));
90 protected UserRoleEnum getRole() {
91 // TODO Auto-generated method stub
92 return UserRoleEnum.DESIGNER;