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.utilities;
23 import org.junit.rules.TestName;
24 import org.openqa.selenium.WebDriver;
25 import org.openqa.selenium.support.ui.Select;
27 public class AdminWorkspaceUIUtilies {
29 public AdminWorkspaceUIUtilies(TestName name, String className) {
31 // TODO Auto-generated constructor stub
34 protected static WebDriver driver;
36 public static void deleteuser(String userId) throws Exception {
37 typeToSearchBox(userId);
38 if (GeneralUIUtils.getWebElements("tdRow") != null) {
39 GeneralUIUtils.getWebElementWaitForVisible("delete" + userId + "").click();
40 GeneralUIUtils.clickOkButton();
44 public static String defineNewUserId(String userId) {
45 GeneralUIUtils.getWebElementWaitForVisible("newUserId").clear();
46 GeneralUIUtils.getWebElementWaitForVisible("newUserId").sendKeys(userId);
51 public static String defineNewMacUid(String MacUid) {
52 GeneralUIUtils.getWebElementWaitForVisible("newUserId").clear();
53 GeneralUIUtils.getWebElementWaitForVisible("newUserId").sendKeys(MacUid);
58 public static String selectUserRole(String Role) {
59 Select selectrole = new Select(GeneralUIUtils.getWebElementWaitForVisible("selectrole"));
60 selectrole.deselectByVisibleText(Role);
61 selectrole.selectByVisibleText(Role);
65 public static void typeToSearchBox(String Text) throws Exception {
66 GeneralUIUtils.getWebElementWaitForVisible("searchbox").clear();
67 GeneralUIUtils.getWebElementWaitForVisible("searchbox").sendKeys(Text);