@Test public void accountDoesNotExist() throws InterruptedException { LoginPage loginPage = new LoginPage(driver); loginPage.getUrl("http://www.flipkart.com/account"); loginPage.setEmail("*****@*****.**"); loginPage.setPassword("Tartaruga011111111"); loginPage.clickLoginButton(); loginPage.waitForElement(ACCOUNT_DOES_NOT_EXIST); assertThat(loginPage.getErrorMessage(), Matchers.containsString(ACCOUNT_DOES_NOT_EXIST)); }
@Test public void wrongPassword() { LoginPage loginPage = new LoginPage(driver); loginPage.getUrl("http://www.flipkart.com/account"); loginPage.setEmail("*****@*****.**"); loginPage.setPassword("tartaruga0000000"); loginPage.clickLoginButton(); loginPage.waitForElement(EMAIL_PASSWORD_COMBINATION_IS_WRONG); assertThat( loginPage.getErrorMessage(), Matchers.containsString(EMAIL_PASSWORD_COMBINATION_IS_WRONG)); }
@Test public void correctLogin() { LoginPage loginPage = new LoginPage(driver); loginPage.getUrl("http://www.flipkart.com/account"); loginPage.setEmail("*****@*****.**"); loginPage.setPassword("Tartaruga01"); loginPage.clickLoginButton(); loginPage.sucssessfulLogin(); }