waitPage();
el = wait.until(ExpectedConditions.presenceOfElementLocated(By.id("proxy-connector-edit-order-div")));
assertTextPresent( "internal" );
- List<WebElement> repos = el.findElements(By.xpath("./div"));
+ List<WebElement> repos = wait.until(ExpectedConditions.numberOfElementsToBe( By.xpath("//div[@id='proxy-connector-edit-order-div']/div"), 2));
Assert.assertTrue("First repo is myrepo", repos.get(0).getText().contains("myrepoid"));
Assert.assertTrue("Second repo is central", repos.get(1).getText().contains("central"));
}
}
+ DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit();
+ capabilities.setJavascriptEnabled( true );
+ capabilities.setVersion( "firefox-52" );
+ WebDriver driver;
if ( seleniumRemote )
{
- return new RemoteWebDriver( new URL( "http://" + seleniumHost + ":" + seleniumPort + "/wd/hub" ),
- DesiredCapabilities.htmlUnit()
+ driver = new RemoteWebDriver( new URL( "http://" + seleniumHost + ":" + seleniumPort + "/wd/hub" ),
+ capabilities
);
}
else
{
- DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit();
- capabilities.setJavascriptEnabled( true );
- capabilities.setVersion( "firefox-52" );
- HtmlUnitDriver driver = new HtmlUnitDriver( capabilities ) {
+ driver = new HtmlUnitDriver( capabilities ) {
@Override
protected WebClient modifyWebClient( WebClient client )
{
return client;
}
};
- return driver;
+
}
+ return driver;
} catch (MalformedURLException e) {
throw new RuntimeException("Initializion of remote driver failed");