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.pages;
23 import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
24 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
25 import org.openqa.selenium.By;
26 import org.openqa.selenium.WebElement;
27 import org.openqa.selenium.support.ui.Select;
29 public class UploadArtifactPopup {
31 public UploadArtifactPopup() {
35 public void loadFile(String path, String filename) {
36 final WebElement browseWebElement = GeneralUIUtils
37 .getWebElementByDataTestId(DataTestIdEnum.ArtifactPopup.BROWSE.getValue());
38 browseWebElement.sendKeys(path + "\\" + filename);
41 public void insertDescription(String artifactDescriptoin) {
42 WebElement artifactDescriptionTextbox = GeneralUIUtils
43 .getWebElementWaitForVisible(DataTestIdEnum.ArtifactPopup.ARTIFACT_DESCRIPTION.getValue());
44 artifactDescriptionTextbox.clear();
45 artifactDescriptionTextbox.sendKeys(artifactDescriptoin);
48 public Select defineArtifactLabel(String requiredArtifactLabel) {
49 Select selectList = GeneralUIUtils.getSelectList("Create New Artifact",
50 DataTestIdEnum.ArtifactPopup.ARTIFACT_LABEL.getValue());
51 WebElement artifactLabelWebElement = GeneralUIUtils.getDriver().findElement(By.name("artifactLabel"));
52 artifactLabelWebElement.clear();
53 artifactLabelWebElement.sendKeys(requiredArtifactLabel);
57 public Select selectArtifactType(String artifactType) {
58 return GeneralUIUtils.getSelectList(artifactType, DataTestIdEnum.ArtifactPopup.ARTIFACT_TYPE.getValue());
61 public void clickAddButton() throws Exception {
62 GeneralUIUtils.getWebButton(DataTestIdEnum.ArtifactPopup.ADD_BUTTON.getValue()).click();
63 GeneralUIUtils.waitForLoader();
66 public void clickCancelButton() throws Exception {
67 GeneralUIUtils.getWebButton(DataTestIdEnum.ArtifactPopup.CANCEL_BUTTON.getValue()).click();
68 GeneralUIUtils.waitForLoader();
71 public void clickUpdateButton() throws Exception {
72 GeneralUIUtils.getWebButton(DataTestIdEnum.ArtifactPopup.UPDATE_BUTTON.getValue()).click();
73 GeneralUIUtils.waitForLoader();