Commit bca8f89b authored by Shanelle Valencia's avatar Shanelle Valencia

Test commit

parent 964cc128
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
package com.nisum;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.WebDriver;
import java.util.concurrent.TimeUnit;
public class TestPomAndPF {
private static WebDriver driver;
private static WebDriverWait wdw;
private static HomePage homePage;
private static Login login;
private static AccountSettingsPF acc;
private String email = "vkrijegccvsknuvnpv@miucce.com";
private String password = "12345678";
private String firstName = "Nisum";
private String lastName = "TestAcct";
private String safewayUrl = "https://www.safeway.com/";
@BeforeAll
public static void initialSetup() {
System.setProperty("webdriver.chrome.driver", "/Users/svalencia/Desktop/webdriver/chromedriver");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
wdw = new WebDriverWait(driver, 5);
homePage = new HomePage(driver);
login = new Login(driver);
acc = new AccountSettingsPF(driver);
}
@Test
public void navigateSafeway() {
homePage.navigateHomePage(safewayUrl);
homePage.getSignInLink();
}
@Test
public void testLogIn() {
navigateSafeway();
login.login(email, password);
// acc.navigateAcctDropdown();
// wdw.until(ExpectedConditions.visibilityOf(acc.userGreeting));
// Assert.assertEquals(acc.userGreeting.getText(), "Hi " + firstName);
acc.navigateAcctInfo();
wdw.until(ExpectedConditions.elementToBeClickable(acc.firstName));
Assertions.assertAll("All information must match",
() -> Assert.assertEquals(firstName, acc.firstName.getAttribute("value")),
() -> Assert.assertEquals(lastName, acc.lastName.getAttribute("value")),
() -> Assert.assertEquals(email, acc.email.getAttribute("value"))
);
login.navigateHome(safewayUrl);
}
@AfterAll
public static void tearDown() {
driver.quit();
}
}
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