Created
March 28, 2021 14:45
-
-
Save ultimate-qa2/a1b03ed01937d279230d09bddcf8eb34 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 | |
public void noCredentialsTest() { | |
WebElement _loginButton = driver.findElement(By.id("login-button")); | |
_loginButton.click(); | |
WebElement _errorMessage = driver.findElement(By.xpath("//h3[@data-test='error']")); | |
// Validate that the message is displayed: | |
Assert.assertTrue(_errorMessage.isDisplayed()); | |
// Validate the message contains the correct text: | |
Assert.assertTrue(_errorMessage.getText().equals("Epic sadface: Username is required")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment