archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [1/2] archiva git commit: Timeout fix for WebDriver test
Date Sun, 11 Jun 2017 19:09:43 GMT
Repository: archiva
Updated Branches:
  refs/heads/master 8a44972c6 -> 975751baf


Timeout fix for WebDriver test


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/9e3a3c60
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/9e3a3c60
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/9e3a3c60

Branch: refs/heads/master
Commit: 9e3a3c60af449cce45c8c3d4760ba1d5f3440b87
Parents: 8a44972
Author: Martin Stockhammer <martin_s@apache.org>
Authored: Sun Jun 11 21:08:44 2017 +0200
Committer: Martin Stockhammer <martin_s@apache.org>
Committed: Sun Jun 11 21:08:44 2017 +0200

----------------------------------------------------------------------
 .../archiva/web/test/RepositoryAdminTest.java       |  2 +-
 .../archiva/web/test/tools/WebdriverUtility.java    | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/9e3a3c60/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
----------------------------------------------------------------------
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 7b034aa..0f52af3 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"));
 

http://git-wip-us.apache.org/repos/asf/archiva/blob/9e3a3c60/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
----------------------------------------------------------------------
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 a1fbca3..6dbbb22 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");


Mime
View raw message