Created
November 8, 2019 18:49
-
-
Save batmi02/e9d52f8eb47ee6acefc9c2a4d2ca7c98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
@UseDataProvider("testForDataFailure") | |
public void testLoginFailure(String username, String password, String expected, String testName, string locatorId) { | |
//try loggin in with username and password | |
login(username,password); | |
//get the text from the alert element | |
String actual = driver.findElement(By.id("alert")).getText(); | |
assertEquals(testName, expected, actual); | |
} | |
@Test | |
@UseDataProvider("testForDataSuccess") | |
public void testLoginSuccess(String username, String password, String expected, String testName, string locatorId) { | |
//try loggin in with username and password | |
login(username,password); | |
//get the text from the alert element | |
String actual = driver.findElement(By.id("logged-user-name")).getText(); | |
assertEquals(testName, expected, actual); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment