continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r924654 - in /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent: AbstractContinuumTest.java AbstractSeleniumTest.java
Date Thu, 18 Mar 2010 06:48:13 GMT
Author: ctan
Date: Thu Mar 18 06:48:12 2010
New Revision: 924654

URL: http://svn.apache.org/viewvc?rev=924654&view=rev
Log:
do not use waitForCondition in IE; getting a permission denied error intermittently

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=924654&r1=924653&r2=924654&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 Mar 18 06:48:12 2010
@@ -866,8 +866,25 @@ public abstract class AbstractContinuumT
         throws Exception
     {
         // the "adding project" interstitial page has an empty title, so we wait for a real
title to appear
-        String condition = "selenium.browserbot.getCurrentWindow().document.title.replace(/^\\s*/,
\"\").replace(/\\s*$/, \"\") != '' && selenium.browserbot.getCurrentWindow().document.getElementById('footer')
!= null";
-        getSelenium().waitForCondition( condition, maxWaitTimeInMs );
+
+        if ( browser.equals( "*iexplore" ) )
+        {
+            int currentIt = 1;
+            int maxIt = 20;
+
+            // there's a problem with ie using waitForCondition
+            while( getTitle().equals( "" ) && currentIt <= maxIt )
+            {
+                Thread.sleep( 1000 );
+                currentIt++;
+            }
+        }
+        else
+        {
+            String condition = "selenium.browserbot.getCurrentWindow().document.title.replace(/^\\s*/,
\"\").replace(/\\s*$/, \"\") != '' && selenium.browserbot.getCurrentWindow().document.getElementById('footer')
!= null";
+            getSelenium().waitForCondition( condition, maxWaitTimeInMs );
+        }
+
         Assert.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=924654&r1=924653&r2=924654&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 Mar 18 06:48:12 2010
@@ -44,6 +44,8 @@ public abstract class AbstractSeleniumTe
 {
     public static String baseUrl;
 
+    public static String browser;
+
     public static String maxWaitTimeInMs;
 
     private static ThreadLocal<Selenium> selenium = new ThreadLocal<Selenium>();
@@ -73,6 +75,8 @@ public abstract class AbstractSeleniumTe
     {
         this.baseUrl = baseUrl;
 
+        this.browser = browser;
+
         if ( getSelenium() == null )
         {
             DefaultSelenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser,
baseUrl );



Mime
View raw message