[Fusionforge-commits] r9494 - in trunk/tests: . func func/PluginsBlocks func/Testing

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Apr 14 21:50:19 CEST 2010


Author: aljeux
Date: 2010-04-14 21:50:19 +0200 (Wed, 14 Apr 2010)
New Revision: 9494

Added:
   trunk/tests/func/PluginsBlocks/
   trunk/tests/func/PluginsBlocks/blocksTest.php
Modified:
   trunk/tests/SeleniumTests.php
   trunk/tests/TarCentos52Tests.php
   trunk/tests/func/Testing/SeleniumGforge.php
Log:
Add PluginsBlock func test

Modified: trunk/tests/SeleniumTests.php
===================================================================
--- trunk/tests/SeleniumTests.php	2010-04-14 19:50:14 UTC (rev 9493)
+++ trunk/tests/SeleniumTests.php	2010-04-14 19:50:19 UTC (rev 9494)
@@ -23,6 +23,7 @@
 		$suite->addTestFiles(glob("func/Tasks/*Test.php"));
 		$suite->addTestFiles(glob("func/Forums/*Test.php"));
 		$suite->addTestFiles(glob("func/News/*Test.php"));
+		$suite->addTestFiles(glob("func/PluginsBlocks/*Test.php"));
 		
 		return $suite;
 	}

Modified: trunk/tests/TarCentos52Tests.php
===================================================================
--- trunk/tests/TarCentos52Tests.php	2010-04-14 19:50:14 UTC (rev 9493)
+++ trunk/tests/TarCentos52Tests.php	2010-04-14 19:50:19 UTC (rev 9494)
@@ -24,6 +24,7 @@
 		$suite->addTestFiles(glob("func/Tasks/*Test.php"));
 		$suite->addTestFiles(glob("func/Forums/*Test.php"));
 		$suite->addTestFiles(glob("func/News/*Test.php"));
+		$suite->addTestFiles(glob("func/PluginsBlocks/*Test.php"));
 		
 		return $suite;
 	}

Added: trunk/tests/func/PluginsBlocks/blocksTest.php
===================================================================
--- trunk/tests/func/PluginsBlocks/blocksTest.php	                        (rev 0)
+++ trunk/tests/func/PluginsBlocks/blocksTest.php	2010-04-14 19:50:19 UTC (rev 9494)
@@ -0,0 +1,98 @@
+<?php
+/*
+ * Copyright (C) 2010 Alcatel-Lucent
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *      
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *              
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */             
+
+/*              
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *              
+ * "The test suite ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *              
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+require_once 'func/Testing/SeleniumGforge.php';
+
+class UserBlocks extends FForge_SeleniumTestCase
+{
+  protected $alreadyActive = 0;
+	
+  function testUserBlocks()
+  {
+  	$this->_activateBlocksPlugin();
+	
+    $this->init();
+
+    $this->click("link=Admin");
+    $this->waitForPageToLoad("30000");
+    $this->click("link=Tools");
+    $this->waitForPageToLoad("30000");
+    $this->click("use_blocksplugin");
+    $this->click("submit");
+    $this->waitForPageToLoad("30000");
+    $this->assertTrue($this->isTextPresent("Project information updated"));
+    $this->click("link=Blocks Admin");
+    $this->waitForPageToLoad("30000");
+    $this->click("activate[summary_description]");
+    $this->click("activate[summary_right]");
+    $this->click("//input[@value='Save Blocks']");
+    $this->waitForPageToLoad("30000");
+
+    $this->open("/plugins/blocks/index.php?id=6&type=admin&pluginname=blocks");
+    $this->click("link=configure");
+    $this->waitForPageToLoad("30000");
+    $this->type("body", "This is my nice block.");
+    $this->click("//input[@value='Save']");
+    $this->waitForPageToLoad("30000");
+    $this->click("//div[@id='maindiv']/form/table/tbody/tr[2]/td[4]/a");
+    $this->waitForPageToLoad("30000");
+    $this->type("body", "{boxTop Project}\nThis is the summary block.\n{boxBottom}");
+    $this->click("//input[@value='Save']");
+    $this->waitForPageToLoad("30000");
+    $this->click("link=Summary");
+    $this->waitForPageToLoad("30000");
+//    $this->assertText("//td[@id='main']/table[1]/tbody/tr/td[1]", "This is my nice block.");
+//    $this->assertEquals("This is the summary block.", $this->getText("//td[@id='main']/table[1]/tbody/tr/td[2]/table[1]/tbody/tr[2]/td"));
+	$this->assertTrue($this->isTextPresent("This is my nice block."));
+	$this->assertTrue($this->isTextPresent("This is the summary block."));
+  }
+  
+  private function _activateBlocksPlugin() {
+  	if (! $this->alreadyActive) {
+  		$this->activatePlugin('blocks');
+		$this->alreadyActive = 1;
+  	}
+  }
+}
+?>

Modified: trunk/tests/func/Testing/SeleniumGforge.php
===================================================================
--- trunk/tests/func/Testing/SeleniumGforge.php	2010-04-14 19:50:14 UTC (rev 9493)
+++ trunk/tests/func/Testing/SeleniumGforge.php	2010-04-14 19:50:19 UTC (rev 9494)
@@ -130,7 +130,7 @@
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Your project has been submitted"));
 		$this->assertTrue($this->isTextPresent("you will receive notification of their decision and further instructions"));
-		$this->click("link=Admin");
+		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Pending (P) (New Project Approval)");
 		$this->waitForPageToLoad("30000");
@@ -161,13 +161,27 @@
 		$this->type("email", $login."@debug.log");
 		$this->click("submit");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Admin");
+		$this->click("link=Site Admin");
 		$this->waitForPageToLoad("30000");
 		$this->click("link=Display Full User List/Edit Users");
 		$this->waitForPageToLoad("30000");
 		$this->click("//a[contains(@href, 'userlist.php?action=activate&user_id=$id')]");
 		$this->waitForPageToLoad("30000");
 	}
+
+	protected function activatePlugin($pluginName) {
+		$this->open( ROOT );
+		$this->waitForPageToLoad("30000");
+		$this->login('admin');
+		$this->click("link=Site Admin");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=Plugin Manager");
+		$this->waitForPageToLoad("30000");
+		$this->click($pluginName);
+		$this->click("//a[contains(@href, \"javascript:change('".ROOT."/admin/pluginman.php?update=$pluginName&action=activate','$pluginName');\")]");
+		$this->waitForPageToLoad("30000");
+		$this->logout();
+	}
 }
 
 ?>




More information about the Fusionforge-commits mailing list