Skip to content

Instantly share code, notes, and snippets.

@shs96c
Last active November 10, 2017 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shs96c/10d24dd2e51651f12a8f2785934b98bc to your computer and use it in GitHub Desktop.
Save shs96c/10d24dd2e51651f12a8f2785934b98bc to your computer and use it in GitHub Desktop.
@Test
public void canAuthenticateUsingBasicAuthentication() {
String url = appServer.whereIs("basicAuth");
driver.get(url);
Alert alert = wait.until(alertIsPresent());
Credentials user = new UserAndPassword("test", "test");
alert.authenticateUsing(user);
WebElement element = wait.until(presenceOfElementLocated(By.tagName("h1")));
assertEquals("authorized", element.getText());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment