You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by jz...@apache.org on 2010/03/18 11:20:40 UTC
svn commit: r924684 - in
/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent:
AbstractContinuumTest.java AbstractSeleniumTest.java
Author: jzurbano
Date: Thu Mar 18 10:20:39 2010
New Revision: 924684
URL: http://svn.apache.org/viewvc?rev=924684&view=rev
Log:
[CONTINUUM-2482] - Replace the use of Thread.sleep to Selenium waitForCondition
* removed Thread.sleep in moveProjectToProjectGroup(), waitAddProject(), and waitForProjectCheckout()
* increased the project waiting time in waitForCondition()
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=924684&r1=924683&r2=924684&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 10:20:39 2010
@@ -620,23 +620,15 @@ public abstract class AbstractContinuumT
throws Exception
{
showProjectGroup( groupName, groupId, groupDescription );
+
+ // wait for project not being used
+ waitForProjectBuild();
+
String id = getFieldValue( "name=projectGroupId" );
String url = baseUrl + "/editProjectGroup.action?projectGroupId=" + id;
getSelenium().open( url );
waitPage();
- // TODO: it would be better if the project checkout was part of the corresponding "add project" test to
- // ensure it was in place
- int count = 0;
- while ( isTextPresent( "Projects that are members of this project group are still being checked out" ) &&
- count < 120 )
- {
- Thread.sleep( 1000 );
- getSelenium().open( url );
- waitPage();
- count ++;
- }
-
assertTextPresent( "Move to Group" );
String xPath = "//preceding::th/label[contains(text(),'" + projectName + "')]//following::select";
selectValue( xPath, newProjectGroup );
@@ -862,7 +854,7 @@ public abstract class AbstractContinuumT
waitAddProject( title );
}
- public void waitAddProject(String title )
+ public void waitAddProject( String title )
throws Exception
{
// the "adding project" interstitial page has an empty title, so we wait for a real title to appear
@@ -875,7 +867,8 @@ public abstract class AbstractContinuumT
// there's a problem with ie using waitForCondition
while( getTitle().equals( "" ) && currentIt <= maxIt )
{
- Thread.sleep( 1000 );
+ getSelenium().refresh();
+ waitPage();
currentIt++;
}
}
@@ -936,19 +929,11 @@ public abstract class AbstractContinuumT
public void waitForProjectCheckout()
throws Exception
{
- int currentIt = 1;
- int maxIt = 10;
- while ( isElementPresent( "//img[@alt='Checking Out']" ) )
- {
- Thread.sleep( 10000 );
- getSelenium().refresh();
- waitPage();
- if ( currentIt > maxIt )
- {
- Assert.fail( "Timeout, Can't check out projects" );
- }
- currentIt++;
- }
+ getSelenium().refresh();
+ waitPage();
+
+ // wait for project to finish checking out
+ waitForElementPresent( "//img[@alt='Checking Out']", false );
}
public void waitForProjectUpdate()
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=924684&r1=924683&r2=924684&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 10:20:39 2010
@@ -461,6 +461,6 @@ public abstract class AbstractSeleniumTe
public void waitForCondition( String condition )
throws Exception
{
- getSelenium().waitForCondition( condition, maxWaitTimeInMs );
+ getSelenium().waitForCondition( condition, maxProjectWaitTimeInMs );
}
}