Skip to content

Instantly share code, notes, and snippets.

@ddavison
Created October 3, 2013 16:41
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 ddavison/6812928 to your computer and use it in GitHub Desktop.
Save ddavison/6812928 to your computer and use it in GitHub Desktop.
This example shows a very common jUnit Selenium 2 test structure using the project at http://github.com/ddavison/getting-started-with-selenium
/**
* This tests My Site
*/
@Config(url="http://mysite.com", browser=CHROME)
public class TestMySite extends AutomationTest {
@Test
public void testSomething() {
click(By.linkText("something"))
.validateText(By.cssSelector("input"), "something");
}
@Test
public void testSomethingElse() {
check(By.cssSelector("input[type='checkbox']"))
.validateChecked(By.cssSelector("input[type='checkbox']"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment