]> source.dussan.org Git - archiva.git/commitdiff
add a hack for selenium issue http://jira.openqa.org/browse/SRC-302
authorOlivier Lamy <olamy@apache.org>
Mon, 19 Sep 2011 12:40:46 +0000 (12:40 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 19 Sep 2011 12:40:46 +0000 (12:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1172592 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java

index e838e0b27d736d55770e5d987b65206ba55b8d46..ca5fe6334c5cbfdafd494ab08cf21e73e7f11030 100644 (file)
@@ -587,7 +587,7 @@ public abstract class AbstractArchivaTest
     }
 
     public void addManagedRepository( String identifier, String name, String directory, String indexDirectory,
-                                      String type, String cron, String daysOlder, String retentionCount )
+                                      String type, String cron, String daysOlder, String retentionCount, boolean wait)
     {
         // goToRepositoriesPage();
         // clickLinkWithText( "Add" );
@@ -600,7 +600,7 @@ public abstract class AbstractArchivaTest
         setFieldValue( "repository.daysOlder", daysOlder );
         setFieldValue( "repository.retentionCount", retentionCount );
         // TODO
-        clickButtonWithValue( "Add Repository" );
+        clickButtonWithValue( "Add Repository", wait );
     }
 
     // artifact management
index e2223dabe64a546fff88cc7b8d1d73d5f73ccee7..33b12be0a342cd8097398bb9082df146375b42fe 100644 (file)
@@ -29,7 +29,8 @@ public abstract class AbstractSearchTest
         if (!isElementPresent( "quickSearchBox" ) )
         {
             getSelenium().open( "/index.action");
-            getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+            //getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+            waitPage();
             assertElementPresent( "quickSearchSubmit" );
         }
     }
index a36db0234534eb7213f738ac9b932f40e570a53d..76c025a37981655ad09aa2cc2b5c2b5adaf85e33 100644 (file)
@@ -237,7 +237,18 @@ public abstract class AbstractSeleniumTest
     public void waitPage()
     {
         // TODO define a smaller maxWaitTimeJsInMs for wait javascript response for browser side validation
-        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+        //getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+        // http://jira.openqa.org/browse/SRC-302
+        getSelenium().waitForCondition( "selenium.isElementPresent('document.body');", maxWaitTimeInMs );
+        /*
+        try
+        {
+            Thread.sleep( 1000 );
+        }
+        catch ( InterruptedException e )
+        {
+            throw new RuntimeException( "issue on Thread.sleep : " + e.getMessage(), e );
+        }*/
     }
 
     public String getFieldValue( String fieldName )