1 package vid.automation.test.sections;
3 import org.onap.sdc.ci.tests.datatypes.UserCredentials;
4 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
5 import org.openqa.selenium.By;
6 import org.openqa.selenium.WebElement;
7 import static org.junit.Assert.*;
10 public class LoginExternalPage {
13 static private final String SUCCESSFUL_LOGIN_STRING_SEARCH = "Welcome to VID";
15 static void sendUserAndPasswordKeys(UserCredentials userCredentials) {
16 WebElement loginIdInputElem = GeneralUIUtils.getWebElementBy(By.name("loginId"));
17 loginIdInputElem.sendKeys(userCredentials.getUserId());
18 WebElement passwordInputElem = GeneralUIUtils.getWebElementBy(By.name("password"));
19 passwordInputElem.sendKeys(userCredentials.getPassword());
22 static public void performLoginExternal(UserCredentials userCredentials) {
23 sendUserAndPasswordKeys(userCredentials);
24 WebElement loginButton = GeneralUIUtils.getWebElementBy(By.id("loginBtn"), 30);
26 boolean isLoginSuccess = GeneralUIUtils.findAndWaitByText(SUCCESSFUL_LOGIN_STRING_SEARCH, 30);
27 assertTrue(isLoginSuccess);