continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1596864 - in /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent: AbstractContinuumTest.java AbstractSeleniumTest.java
Date Thu, 22 May 2014 13:35:27 GMT
Author: brett
Date: Thu May 22 13:35:27 2014
New Revision: 1596864

URL: http://svn.apache.org/r1596864
Log:
Don't use waitForCondition for page reloads

This appears to have stopped working with latest WebDriver and Firefox

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=1596864&r1=1596863&r2=1596864&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Thu May 22 13:35:27 2014
@@ -779,23 +779,13 @@ public abstract class AbstractContinuumT
     {
         // the "adding project" interstitial page has an empty title, so we wait for a real
title to appear
 
-        if ( browser.equals( "*iexplore" ) )
-        {
-            int currentIt = 1;
-            int maxIt = 20;
+        int currentIt = 1;
+        int maxIt = 20;
 
-            // there's a problem with ie using waitForCondition
-            while ( getTitle().equals( "" ) && currentIt <= maxIt )
-            {
-                waitPage();
-                currentIt++;
-            }
-        }
-        else
+        while ( getTitle().equals( "" ) && currentIt <= maxIt )
         {
-            String condition =
-                "selenium.browserbot.getCurrentWindow().document.title.replace(/^\\s*/, \"\").replace(/\\s*$/,
\"\") != '' && selenium.browserbot.getCurrentWindow().document.getElementById('footer')
!= null";
-            waitForCondition( condition );
+            waitPage();
+            currentIt++;
         }
 
         assertEquals( getTitle(), title );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=1596864&r1=1596863&r2=1596864&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Thu May 22 13:35:27 2014
@@ -388,45 +388,23 @@ public abstract class AbstractSeleniumTe
 
     protected void waitForOneOfElementsPresent( List<String> locators, boolean shouldBePresent
)
     {
-        if ( browser.equals( "*iexplore" ) )
-        {
-            int currentIt = 0;
-            int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
-            String pageLoadTimeInMs = maxWaitTimeInMs;
+        int currentIt = 0;
+        int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
+        String pageLoadTimeInMs = maxWaitTimeInMs;
 
-            while ( currentIt < maxIt )
-            {
-                for ( String locator : locators )
-                {
-                    if ( isElementPresent( locator ) == shouldBePresent )
-                    {
-                        return;
-                    }
-                }
-
-                getSelenium().waitForPageToLoad( pageLoadTimeInMs );
-                currentIt++;
-            }
-        }
-        else
+        while ( currentIt < maxIt )
         {
-            StringBuilder condition = new StringBuilder();
-            String operator = "";
             for ( String locator : locators )
             {
-                condition.append( operator );
-                condition.append( "(selenium.isElementPresent(\"" ).append( locator ).append(
"\")" );
-                condition.append( " == " );
-                condition.append( shouldBePresent ).append( ")" );
-                operator = "||";
+                if ( isElementPresent( locator ) == shouldBePresent )
+                {
+                    return;
+                }
             }
-            waitForCondition( "(" + condition + ")" );
-        }
-    }
 
-    void waitForCondition( String condition )
-    {
-        getSelenium().waitForCondition( condition, maxProjectWaitTimeInMs );
+            getSelenium().waitForPageToLoad( pageLoadTimeInMs );
+            currentIt++;
+        }
     }
 
     void assertEnabled()



Mime
View raw message