aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2017-06-11 21:08:44 +0200
committerMartin Stockhammer <martin_s@apache.org>2017-06-11 21:08:44 +0200
commit9e3a3c60af449cce45c8c3d4760ba1d5f3440b87 (patch)
tree376109aa6aac1f49505d77cc97c907c4c6468c73
parent8a44972c6412d43c7e25c5c0ad39a4252d575206 (diff)
downloadarchiva-9e3a3c60af449cce45c8c3d4760ba1d5f3440b87.tar.gz
archiva-9e3a3c60af449cce45c8c3d4760ba1d5f3440b87.zip
Timeout fix for WebDriver test
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java16
2 files changed, 10 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
index 7b034aa49..0f52af3b4 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
@@ -96,7 +96,7 @@ public class RepositoryAdminTest
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"));
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
index a1fbca3bf..6dbbb228d 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
@@ -120,18 +120,19 @@ public class WebdriverUtility
}
}
+ 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 )
{
@@ -141,8 +142,9 @@ public class WebdriverUtility
return client;
}
};
- return driver;
+
}
+ return driver;
} catch (MalformedURLException e) {
throw new RuntimeException("Initializion of remote driver failed");