[Fusionforge-commits] r10231 - in trunk/tests/func: . News Site Testing Trackers

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Tue Jul 13 21:59:41 CEST 2010


Author: aljeux
Date: 2010-07-13 21:59:41 +0200 (Tue, 13 Jul 2010)
New Revision: 10231

Modified:
   trunk/tests/func/News/newsTest.php
   trunk/tests/func/Site/loginTest.php
   trunk/tests/func/Site/projectsTest.php
   trunk/tests/func/Site/top.php
   trunk/tests/func/Site/troveTest.php
   trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php
   trunk/tests/func/Testing/SeleniumGforge.php
   trunk/tests/func/Trackers/relationTest.php
   trunk/tests/func/Trackers/trackersTest.php
   trunk/tests/func/Trackers/workflowTest.php
   trunk/tests/func/config.php.buildbot
   trunk/tests/func/config.php.sample
   trunk/tests/func/config.php.tests
   trunk/tests/func/db_reload.php
Log:
Tests: deprecate define BASE => ROOT and misc fixes

Modified: trunk/tests/func/News/newsTest.php
===================================================================
--- trunk/tests/func/News/newsTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/News/newsTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -94,7 +94,7 @@
 		// Check modification of a news.
 		$this->click("link=News");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '" . BASE . "/news/admin/?group_id=6')]");
+		$this->click("//a[contains(@href, '" . ROOT . "/news/admin/?group_id=6')]");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Second news");
 		$this->waitForPageToLoad("30000");
@@ -123,7 +123,7 @@
 		$this->assertTrue($this->isTextPresent("Special ' chars \""));
 		$this->click("link=News");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '". BASE . "/news/admin/?group_id=6')]");
+		$this->click("//a[contains(@href, '". ROOT . "/news/admin/?group_id=6')]");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Test3");
 		$this->waitForPageToLoad("30000");

Modified: trunk/tests/func/Site/loginTest.php
===================================================================
--- trunk/tests/func/Site/loginTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Site/loginTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -53,7 +53,7 @@
 	function testLogin()
 	{
 		// Test with a normal login.
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
 		$this->type("form_loginname", "admin");
@@ -65,7 +65,7 @@
 		$this->logout();
 				
 		// Test with an empty password.
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
 		$this->type("form_loginname", "admin");
@@ -77,7 +77,7 @@
 		$this->assertTrue($this->isTextPresent("Log In"));
 		
 		// Test with a wrong password.
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
 		$this->type("form_loginname", "admin");

Modified: trunk/tests/func/Site/projectsTest.php
===================================================================
--- trunk/tests/func/Site/projectsTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Site/projectsTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -52,7 +52,7 @@
 	// After creation, project is visible on the main page.
 	function testSimpleCreate()
 	{
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
 		$this->type("form_loginname", "admin");
@@ -89,7 +89,7 @@
 
 	function testCharsCreateTestCase()
 	{
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
 		$this->type("form_loginname", "admin");

Modified: trunk/tests/func/Site/top.php
===================================================================
--- trunk/tests/func/Site/top.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Site/top.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -49,7 +49,7 @@
 {
     function testWalkInTop()
     {
-    	$this->open( BASE );
+    	$this->open( ROOT );
 
 		// Test that from the main page we access the most active this week.    
 	    $this->click("link=[ More ]");

Modified: trunk/tests/func/Site/troveTest.php
===================================================================
--- trunk/tests/func/Site/troveTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Site/troveTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -26,7 +26,7 @@
 {
 	function testTroveAdmin()
 	{
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->login('admin');
 		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");

Modified: trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php
===================================================================
--- trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -13,9 +13,10 @@
 		
 		system("scp -rp ~/fusionforge_repo root@".HOST.":");
 		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/dag-rpmforge.repo root@".HOST.":/etc/yum.repos.d/");
+
 //		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/fusionforge-ci.repo root@".HOST.":/etc/yum.repos.d/");
 		if (getenv('FFORGE_RPM_REPO')) {
-			system("ssh root@".HOST." 'cd /etc/yum.repos.d/; wget FFORGE_RPM_REPO/fusionforge.repo");
+			system("ssh root@".HOST." 'cd /etc/yum.repos.d/; wget ".getenv('FFORGE_RPM_REPO')."/fusionforge.repo'");
 		}
 
 		# Prefill yum cache to reduce real downloads.

Modified: trunk/tests/func/Testing/SeleniumGforge.php
===================================================================
--- trunk/tests/func/Testing/SeleniumGforge.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Testing/SeleniumGforge.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -43,7 +43,9 @@
  * ALONE BASIS."
  */
 
-require_once 'func/config.php';
+$config = getenv('CONFIG_PHP') ? getenv('CONFIG_PHP'): 'func/config.php';
+require_once $config;
+
 require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
 
 class FForge_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
@@ -76,7 +78,7 @@
     protected function init() {
 		$this->createProject('ProjectA');
 
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
     }
@@ -101,7 +103,7 @@
 	protected function logout()
 	{
 //		$this->click("link=Log Out");
-		$this->open( BASE ."/account/logout.php" );
+		$this->open( ROOT ."/account/logout.php" );
 		$this->waitForPageToLoad("30000");
 	}
 	
@@ -115,7 +117,7 @@
 		$unix_name = strtolower($name);
 		
 		// Create a simple project.
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent('Log In'));
 		$this->click("link=Log In");

Modified: trunk/tests/func/Trackers/relationTest.php
===================================================================
--- trunk/tests/func/Trackers/relationTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Trackers/relationTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -52,14 +52,14 @@
 		$this->createProject('ProjectA');
 					
 		// Testing extra-fields
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Tracker");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Bugs");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '".BASE. "/tracker/admin/?group_id=6&atid=101')]");
+		$this->click("//a[contains(@href, '".ROOT. "/tracker/admin/?group_id=6&atid=101')]");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Manage Custom Fields");
 		$this->waitForPageToLoad("30000");

Modified: trunk/tests/func/Trackers/trackersTest.php
===================================================================
--- trunk/tests/func/Trackers/trackersTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Trackers/trackersTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -52,7 +52,7 @@
 		$this->createProject('ProjectA');
 
 		// Test: Create a simple bug report (Message1/Text1).
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Tracker");
@@ -126,14 +126,14 @@
 		$this->createProject('ProjectA');
 
 		// Testing extra-fields
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Tracker");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Bugs");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '".BASE. "/tracker/admin/?group_id=6&atid=101')]");
+		$this->click("//a[contains(@href, '".ROOT. "/tracker/admin/?group_id=6&atid=101')]");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Manage Custom Fields");
 		$this->waitForPageToLoad("30000");
@@ -142,7 +142,7 @@
 		$this->click("field_type");
 		$this->click("post_changes");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '".BASE. "/tracker/admin/index.php?add_opt=1&boxid=22&group_id=6&atid=101')]");
+		$this->click("//a[contains(@href, '".ROOT. "/tracker/admin/index.php?add_opt=1&boxid=22&group_id=6&atid=101')]");
 		$this->waitForPageToLoad("30000");
 		$this->type("name", "1");
 		$this->click("post_changes");
@@ -160,7 +160,7 @@
 		$this->assertTrue($this->isTextPresent("Element inserted"));
 
 		// Testing [#3649]: 0 not accepted when modifying a select list value
-		$this->open(BASE."/tracker/admin/index.php?group_id=6&atid=101&add_extrafield=1");
+		$this->open(ROOT."/tracker/admin/index.php?group_id=6&atid=101&add_extrafield=1");
 		$this->click("//tr[@id='field-number']/td[3]/a[5]");
 		$this->waitForPageToLoad("30000");
 		$this->type("name", "10");
@@ -179,7 +179,7 @@
 		$this->createProject('ProjectA');
 
 		// Create a new tracker and delete it after.
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Tracker");

Modified: trunk/tests/func/Trackers/workflowTest.php
===================================================================
--- trunk/tests/func/Trackers/workflowTest.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/Trackers/workflowTest.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -52,14 +52,14 @@
 		$this->createProject('ProjectA');
 			
 		// Testing extra-fields
-		$this->open( BASE );
+		$this->open( ROOT );
 		$this->click("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Tracker");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Bugs");
 		$this->waitForPageToLoad("30000");
-		$this->click("//a[contains(@href, '".BASE. "/tracker/admin/?group_id=6&atid=101')]");
+		$this->click("//a[contains(@href, '".ROOT. "/tracker/admin/?group_id=6&atid=101')]");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Manage Custom Fields");
 		$this->waitForPageToLoad("30000");

Modified: trunk/tests/func/config.php.buildbot
===================================================================
--- trunk/tests/func/config.php.buildbot	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/config.php.buildbot	2010-07-13 19:59:41 UTC (rev 10231)
@@ -12,21 +12,20 @@
 
 // Host where selenium-rc is running
 define ('SELENIUM_RC_HOST', getenv('SELENIUM_RC_HOST'));
-define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR');
+define ('SELENIUM_RC_DIR', getenv('SELENIUM_RC_DIR'));
 
 // The forge's hostname
 define ('HOST', getenv('HOST'));
 
 // Base URL where FusionForge is installed
 define ('ROOT', '');
-define ('BASE', '');
 
 // Database connection parameters.
 define('DB_TYPE', 'pgsql');         // Values: mysql, pgsql
 define('DB_NAME', 'fforge');
 define('DB_USER', 'gforge');
 define('DB_PASSWORD', '@@FFDB_PASS@@');
-define('DB_INIT_CMD', 'php '.dirname(__FILE__).'/db_reload.php');
+define('DB_INIT_CMD', "ssh root@".HOST." 'cd /usr/share/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot php db_reload.php'");
 
 // this should be an existing user of the forge together with its password
 // (the password should be different from 'xxxxxx')

Modified: trunk/tests/func/config.php.sample
===================================================================
--- trunk/tests/func/config.php.sample	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/config.php.sample	2010-07-13 19:59:41 UTC (rev 10231)
@@ -19,7 +19,6 @@
 
 // Base URL where FusionForge is installed
 define ('ROOT', '');
-define ('BASE', '');
 
 // Database connection parameters.
 define('DB_TYPE', 'pgsql');         // Values: mysql, pgsql

Modified: trunk/tests/func/config.php.tests
===================================================================
--- trunk/tests/func/config.php.tests	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/config.php.tests	2010-07-13 19:59:41 UTC (rev 10231)
@@ -17,7 +17,7 @@
 define ('URL', 'http://centos52.local/');
 
 // Base URL where FusionForge is installed
-define ('BASE', '');
+define ('ROOT', '');
 
 // Database connection parameters.
 define('DB_TYPE', 'pgsql');         // Values: mysql, pgsql

Modified: trunk/tests/func/db_reload.php
===================================================================
--- trunk/tests/func/db_reload.php	2010-07-13 19:42:16 UTC (rev 10230)
+++ trunk/tests/func/db_reload.php	2010-07-13 19:59:41 UTC (rev 10231)
@@ -100,10 +100,10 @@
 // Temporary.
 $sys_default_theme_id = 5;
 
-set_include_path(".:/opt/gforge/:/opt/gforge/www/include/:/etc/gforge/");
+//set_include_path(".:/opt/gforge/:/opt/gforge/www/include/:/etc/gforge/");
 
 require_once '../../gforge/www/env.inc.php';    
-require_once $gfwww.'include/squal_pre.php';    
+require_once $gfwww.'include/pre.php';
 
 // Add alcatel theme to the database.
 db_query_params ('INSERT INTO themes (theme_id, dirname, fullname, enabled) VALUES (5, $1, $2, true)',




More information about the Fusionforge-commits mailing list