Skip to content

Instantly share code, notes, and snippets.

@alsargent
Last active October 7, 2019 21:19
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 alsargent/e5b3e39236d3f654cc8d5faa43e0cf20 to your computer and use it in GitHub Desktop.
Save alsargent/e5b3e39236d3f654cc8d5faa43e0cf20 to your computer and use it in GitHub Desktop.
Functional testing with Visual AI
@Test
public void loginTest() {
//Open browser
driver.get("http://localhost:8000/loginBefore.html");
//Click on the Login button
driver.findElement(By.id("log-in")).click();
//Start the test
eyes.open(driver, "Login App", "Login Page Test", new RectangleSize(800, 800));
//Take a screenshot so AI can analyze (and ignore large displacements)
eyes.checkWindow("Login Window");
//End the test
eyes.closeAsync();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment