[Fusionforge-commits] r12815 - in branches/Branch_5_1/tests/func: Site Testing

Alain Peyrat aljeux at fusionforge.org
Wed Mar 16 22:40:43 CET 2011


Author: aljeux
Date: 2011-03-16 22:40:43 +0100 (Wed, 16 Mar 2011)
New Revision: 12815

Modified:
   branches/Branch_5_1/tests/func/Site/loginTest.php
   branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php
Log:
Allow tests to pass when selenium-rc is reusing sessions

Modified: branches/Branch_5_1/tests/func/Site/loginTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Site/loginTest.php	2011-03-16 21:36:47 UTC (rev 12814)
+++ branches/Branch_5_1/tests/func/Site/loginTest.php	2011-03-16 21:40:43 UTC (rev 12815)
@@ -51,8 +51,10 @@
 	{
 		// Test with a normal login.
 		$this->open( ROOT );
-		$this->click("link=Log In");
-		$this->waitForPageToLoad("30000");
+		if (!$this->isTextPresent("Log In")) {
+			$this->logout();
+		}
+		$this->clickAndWait("link=Log In");
 
 		// Check that current URL's base is the same as ROOT
 		// If the forge redirects to other URL than the one

Modified: branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php
===================================================================
--- branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php	2011-03-16 21:36:47 UTC (rev 12814)
+++ branches/Branch_5_1/tests/func/Testing/SeleniumGforge.php	2011-03-16 21:40:43 UTC (rev 12815)
@@ -226,6 +226,9 @@
 	protected function login($username)
 	{
 		$this->open( ROOT );
+		if ($this->isTextPresent('Log Out')) {
+			$this->logout();
+		}
 		$this->clickAndWait("link=Log In");
 		$this->triggeredLogin($username);
 	}




More information about the Fusionforge-commits mailing list