summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
committerOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
commit1cfb08779ea0e00be69e072a940b3063e049fe6b (patch)
tree6602a900387c8393ed0dcd81c0539381632903c6 /vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java
parent2f20b001b9243e0f8b44aecc768ec265fd538732 (diff)
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java b/vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java
new file mode 100644
index 00000000..c1053d2a
--- /dev/null
+++ b/vid-automation/src/main/java/vid/automation/test/sections/LoginExternalPage.java
@@ -0,0 +1,29 @@
+package vid.automation.test.sections;
+
+import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import static org.junit.Assert.*;
+
+
+public class LoginExternalPage {
+
+
+ static private final String SUCCESSFUL_LOGIN_STRING_SEARCH = "Welcome to VID";
+
+ static void sendUserAndPasswordKeys(UserCredentials userCredentials) {
+ WebElement loginIdInputElem = GeneralUIUtils.getWebElementBy(By.name("loginId"));
+ loginIdInputElem.sendKeys(userCredentials.getUserId());
+ WebElement passwordInputElem = GeneralUIUtils.getWebElementBy(By.name("password"));
+ passwordInputElem.sendKeys(userCredentials.getPassword());
+ }
+
+ static public void performLoginExternal(UserCredentials userCredentials) {
+ sendUserAndPasswordKeys(userCredentials);
+ WebElement loginButton = GeneralUIUtils.getWebElementBy(By.id("loginBtn"), 30);
+ loginButton.click();
+ boolean isLoginSuccess = GeneralUIUtils.findAndWaitByText(SUCCESSFUL_LOGIN_STRING_SEARCH, 30);
+ assertTrue(isLoginSuccess);
+ }
+}