Commit 3f6c1d29 authored by Darrick Yong's avatar Darrick Yong

add tests for phone

parent ce74d36f
...@@ -18,17 +18,22 @@ public class AccountSettingsPage { ...@@ -18,17 +18,22 @@ public class AccountSettingsPage {
@FindBy(how = How.ID, using = "emailIdaccount") @FindBy(how = How.ID, using = "emailIdaccount")
WebElement emailInput; WebElement emailInput;
@FindBy(how = How.ID, using = "phoneNumber")
WebElement phoneInput;
public AccountSettingsPage(WebDriver driver) { public AccountSettingsPage(WebDriver driver) {
this.driver = driver; this.driver = driver;
PageFactory.initElements(driver, this); PageFactory.initElements(driver, this);
} }
public void confirmLogin(String firstName, String lastName, String email) { public void confirmLogin(String firstName, String lastName, String email, String phone) {
assertAll("First name, last name, and email should match account props", assertAll("First name, last name, and email should match account props",
() -> assertEquals(firstName, firstNameInput.getAttribute("value")), () -> assertEquals(firstName, firstNameInput.getAttribute("value")),
() -> assertEquals(lastName, lastNameInput.getAttribute("value")), () -> assertEquals(lastName, lastNameInput.getAttribute("value")),
() -> assertEquals(email, emailInput.getAttribute("value")) () -> assertEquals(email, emailInput.getAttribute("value")),
() -> assertEquals(phone, phoneInput.getAttribute("value"))
// () -> assertEquals(email, firstName) // should fail // () -> assertEquals(email, firstName) // should fail
); );
} }
......
...@@ -10,8 +10,6 @@ public class HomePage { ...@@ -10,8 +10,6 @@ public class HomePage {
@FindBy(how = How.XPATH, using = "//a[@class='menu-nav__profile-button']") @FindBy(how = How.XPATH, using = "//a[@class='menu-nav__profile-button']")
WebElement signInUpLink; WebElement signInUpLink;
public HomePage(WebDriver driver) { public HomePage(WebDriver driver) {
this.driver = driver; this.driver = driver;
PageFactory.initElements(driver, this); PageFactory.initElements(driver, this);
......
...@@ -28,6 +28,7 @@ public class GetAccountProperties { ...@@ -28,6 +28,7 @@ public class GetAccountProperties {
res.put("password", props.getProperty("password")); res.put("password", props.getProperty("password"));
res.put("firstName", props.getProperty("firstName")); res.put("firstName", props.getProperty("firstName"));
res.put("lastName", props.getProperty("lastName")); res.put("lastName", props.getProperty("lastName"));
res.put("phone", props.getProperty("phone"));
} catch (Exception e) { } catch (Exception e) {
System.out.println(e); System.out.println(e);
......
...@@ -2,3 +2,4 @@ email=vkrijegccvsknuvnpv@miucce.com ...@@ -2,3 +2,4 @@ email=vkrijegccvsknuvnpv@miucce.com
password=12345678 password=12345678
firstName=Nisum firstName=Nisum
lastName=TestAcct lastName=TestAcct
phone=3141592635
\ No newline at end of file
...@@ -15,6 +15,7 @@ public class TestSafeway { ...@@ -15,6 +15,7 @@ public class TestSafeway {
String password = props.get("password"); String password = props.get("password");
String firstName = props.get("firstName"); String firstName = props.get("firstName");
String lastName = props.get("lastName"); String lastName = props.get("lastName");
String phone = props.get("phone");
public TestSafeway() throws IOException { public TestSafeway() throws IOException {
} }
...@@ -48,7 +49,7 @@ public class TestSafeway { ...@@ -48,7 +49,7 @@ public class TestSafeway {
waiter.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Account Settings"))); waiter.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Account Settings")));
AccountSettingsPage accountSettingsPage = new AccountSettingsPage(driver); AccountSettingsPage accountSettingsPage = new AccountSettingsPage(driver);
accountSettingsPage.confirmLogin(firstName, lastName, email); accountSettingsPage.confirmLogin(firstName, lastName, email, phone);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment