Skip to content

Instantly share code, notes, and snippets.

@zdwolfe
Last active October 18, 2015 20:24
Show Gist options
  • Save zdwolfe/49338369ed47a84ebafd to your computer and use it in GitHub Desktop.
Save zdwolfe/49338369ed47a84ebafd to your computer and use it in GitHub Desktop.
@DataProvider(name = "searchBoxProvider")
public Object[][] searchBoxProvider() {
return new Object[][] {
{ "http://www.google.com", "lst-ib" , new DefaultSearchEngine()},
{ "https://duckduckgo.com", "search_form_input_homepage", new DuckDuckGo()},
{ "https://www.dogpile.com/", "topSearchTextBox", new DefaultSearchEngine()},
{ "http://www.bing.com", "sb_form_q", new DefaultSearchEngine()}
};
}
@Test(dataProvider = "searchBoxProvider")
public void shouldHaveVisibleSearchBox(String url, String searchBoxId, SearchEngine searchEngine) {
WebDriver driver = new FirefoxDriver();
driver.get(url);
searchEngine.preparePage(driver);
WebElement searchBox = driver.findElement(By.id(searchBoxId));
assertTrue(searchBox.isDisplayed());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment