[Fusionforge-commits] FusionForge branch master updated. v6.1-189-g18b3ccd

Franck Villaume nerville at libremir.placard.fr.eu.org
Sat Jan 19 13:24:41 CET 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  18b3ccde2496902d4835a38303e44e07bcd7276a (commit)
       via  07f4a5cf99bf80eaa9c964bc11e3f96bd816b73d (commit)
       via  bd4f553e28a108caeead3fb978f121c67a8782e2 (commit)
      from  71289334956c6fdcd5be7734d7fe6e9a52f4b442 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=18b3ccde2496902d4835a38303e44e07bcd7276a

commit 18b3ccde2496902d4835a38303e44e07bcd7276a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Jan 19 13:24:10 2019 +0100

    adjust projectsTest to Selenium2TestCase

diff --git a/tests/func/10_Site/projectsTest.php b/tests/func/10_Site/projectsTest.php
index 1efcae8..0426aa6 100644
--- a/tests/func/10_Site/projectsTest.php
+++ b/tests/func/10_Site/projectsTest.php
@@ -54,23 +54,24 @@ class CreateProject extends FForge_SeleniumTestCase
 	{
 		// "Manual" procedure
 		$this->login (FORGE_ADMIN_USERNAME);
-		$this->click("link=My Page");
+		$this->url(ROOT."/my/");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Register Project");
+		$this->clickAndWait("link=Register Project");
 		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Project Full Name"));
 		$this->type("full_name", "ProjectA");
 		$this->type("purpose", "This is a simple description for ProjectA");
 		$this->type("//textarea[@name='description']", "This is the public description for ProjectA.");
 		$this->type("unix_name", "projecta");
-		$this->click("//input[@name='scm' and @value='scmsvn']");
+		$this->clickAndWait("//input[@name='scm' and @value='scmsvn']");
 		$this->assertTrue($this->isElementPresent("//select[@name='built_from_template']"));
-		$this->click("submit");
+		$this->clickAndWait("submit");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
-		$this->click("link=Home");
+		$this->url(ROOT);
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("ProjectA"));
-		$this->click("link=ProjectA");
+		$this->clickAndWait("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectA."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
@@ -79,33 +80,33 @@ class CreateProject extends FForge_SeleniumTestCase
 	function testCharsCreateTestCase()
 	{
 		$this->login(FORGE_ADMIN_USERNAME);
-		$this->click("link=My Page");
+		$this->url(ROOT."/my/");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Register Project");
+		$this->clickAndWait("link=Register Project");
 		$this->waitForPageToLoad("30000");
 		$this->type("full_name", "Project ' & B");
 		$this->type("purpose", "This is a & été simple description for project B");
 		$this->type("//textarea[@name='description']", "This is & été the public description for project B.");
 		$this->type("unix_name", "projectb");
-		$this->click("//input[@name='scm' and @value='scmsvn']");
-		$this->click("submit");
+		$this->clickAndWait("//input[@name='scm' and @value='scmsvn']");
+		$this->clickAndWait("submit");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
-		$this->click("link=Home");
+		$this->url(ROOT);
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Project ' & B"));
-		$this->click("link=Project ' & B");
+		$this->clickAndWait("link=Project ' & B");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("This is & été the public description for project B."));
 
-		$this->click("link=Projects");
+		$this->url(ROOT."/projects");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Project Tree");
+		$this->clickAndWait("link=Project Tree");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Project List");
+		$this->clickAndWait("link=Project List");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Project ' & B - This is & été the public description for project B."));
-		$this->click("link=My Page");
+		$this->url(ROOT."/my/");
 		$this->waitForPageToLoad("30000");
 		$this->assertFalse($this->isTextPresent("Project ' & B"));
 	}
@@ -114,10 +115,10 @@ class CreateProject extends FForge_SeleniumTestCase
 	{
 		// Test our high-level functions (testing the test-suite)
 		$this->createProject ('ProjectB');
-		$this->click("link=Home");
+		$this->url(ROOT);
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("ProjectB"));
-		$this->click("link=ProjectB");
+		$this->clickAndWait("link=ProjectB");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectB."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
@@ -136,15 +137,15 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->open( ROOT . '/projects/tmpl') ;
 		$this->waitForPageToLoad("30000");
 
-		$this->click("link=Admin");
+		$this->clickAndWait("link=Admin");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Tools");
+		$this->clickAndWait("link=Tools");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Trackers Administration");
+		$this->clickAndWait("link=Trackers Administration");
 		$this->waitForPageToLoad("30000");
 		$this->type("name", "Local tracker for UNIXNAME");
 		$this->type("//input[@name='description']", "Tracker for PUBLICNAME (UNIXNAME)");
-		$this->click("post_changes");
+		$this->clickAndWait("post_changes");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Tracker created successfully"));
 
@@ -152,7 +153,7 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->assertTrue($this->isElementPresent("//a//*[normalize-space(.)='Tracker']"));
 		$this->assertTrue($this->isElementPresent("//a//*[normalize-space(.)='Forums']"));
 		$this->assertTrue($this->isElementPresent("//a//*[normalize-space(.)='Tasks']"));
-		$this->click("link=Tracker");
+		$this->clickAndWait("link=Tracker");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Tracker for ProjectA (projecta)"));
 
@@ -160,12 +161,12 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->open( ROOT . '/projects/tmpl') ;
 		$this->waitForPageToLoad("30000");
 
-		$this->click("link=Admin");
+		$this->clickAndWait("link=Admin");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Tools");
+		$this->clickAndWait("link=Tools");
 		$this->waitForPageToLoad("30000");
 		$this->uncheck("//input[@name='use_tracker']") ;
-		$this->click("submit");
+		$this->clickAndWait("submit");
 		$this->waitForPageToLoad("30000");
 
 		$this->createAndGoto('ProjectB');
@@ -176,9 +177,9 @@ class CreateProject extends FForge_SeleniumTestCase
 		// Create an empty project despite the template being full
 		$this->populateStandardTemplate('all');
 
-		$this->click("link=My Page");
+		$this->url(ROOT."/my/");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Register Project");
+		$this->clickAndWait("link=Register Project");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isElementPresent("//select[@name='built_from_template']"));
 		$this->type("full_name", "ProjectA");
@@ -186,14 +187,14 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->type("//textarea[@name='description']", "This is the public description for ProjectA.");
 		$this->type("unix_name", "projecta");
 		$this->select("//select[@name='built_from_template']", "label=Start from empty project");
-		$this->click("//input[@name='scm' and @value='scmsvn']");
-		$this->click("submit");
+		$this->clickAndWait("//input[@name='scm' and @value='scmsvn']");
+		$this->clickAndWait("submit");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
-		$this->click("link=Home");
+		$this->url(ROOT);
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("ProjectA"));
-		$this->click("link=ProjectA");
+		$this->clickAndWait("link=ProjectA");
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectA."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
@@ -212,32 +213,32 @@ class CreateProject extends FForge_SeleniumTestCase
 		// Non-regression test for Adacore ticket K720-005
 		$this->createUser('toto');
 
-		$this->click("link=Site Admin");
+		$this->url(ROOT."/admin/");
 		$this->waitForPageToLoad("30000");
 		$this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Forge administrators") ;
-		$this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
+		$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
 		$this->waitForPageToLoad("30000");
 		$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "toto") ;
-		$this->click ("//input[@value='Add User']") ;
+		$this->clickAndWait("//input[@value='Add User']") ;
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("toto Lastname"));
 
 		$this->registerProject('testal1','toto');
 
-		$this->click("link=Site Admin");
+		$this->url(ROOT."/admin/");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Display Full Project List/Edit Projects");
+		$this->clickAndWait("link=Display Full Project List/Edit Projects");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=testal1");
+		$this->clickAndWait("link=testal1");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Permanently Delete Project");
+		$this->clickAndWait("link=Permanently Delete Project");
 		$this->waitForPageToLoad("30000");
-		$this->click("sure");
-		$this->click("reallysure");
-		$this->click("reallyreallysure");
-		$this->click("submit");
+		$this->clickAndWait("sure");
+		$this->clickAndWait("reallysure");
+		$this->clickAndWait("reallyreallysure");
+		$this->clickAndWait("submit");
 		$this->waitForPageToLoad("30000");
-		$this->click("link=Home");
+		$this->url(ROOT);
 		$this->waitForPageToLoad("30000");
 		$this->assertFalse($this->isTextPresent("testal1"));
 
@@ -252,13 +253,13 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->uncheck("//input[@name='use_mail']") ;
 		$this->clickAndWait("submit");
 
-		$this->clickAndWait("link=Site Admin");
+		$this->url(ROOT."/admin/");
 		$this->clickAndWait("link=Display Full Project List/Edit Projects");
 		$this->clickAndWait("link=ProjectA");
 		$this->clickAndWait("link=Permanently Delete Project");
-		$this->click("sure");
-		$this->click("reallysure");
-		$this->click("reallyreallysure");
+		$this->clickAndWait("sure");
+		$this->clickAndWait("reallysure");
+		$this->clickAndWait("reallyreallysure");
 		$this->clickAndWait("submit");
 		$this->clickAndWait("link=Home");
 		$this->assertFalse($this->isTextPresent("ProjectA"));

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=07f4a5cf99bf80eaa9c964bc11e3f96bd816b73d

commit 07f4a5cf99bf80eaa9c964bc11e3f96bd816b73d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Jan 19 13:23:41 2019 +0100

    initial support for isElementPresent

diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index b8c589e..f5d0a5b 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -582,6 +582,13 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
 		return true;
 	}
 
+	function isElementPresent($element) {
+		if ($this->byXpath($element) instanceof PHPUnit_Extensions_Selenium2TestCase_Element) {
+			return true;
+		}
+		return false;
+	}
+
 	function getLocation() {
 		return $this->execute(array(
 				'script' => 'return window.location.href;',

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=bd4f553e28a108caeead3fb978f121c67a8782e2

commit bd4f553e28a108caeead3fb978f121c67a8782e2
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Jan 19 12:46:16 2019 +0100

    implement waitForPageToLoad, add support for Xpath in type() function. Remove moveto to avoid outofbound error

diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 475380b..b8c589e 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -200,8 +200,7 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
 			//default case
 			$myelement = $this->byName($link);
 		}
-		$this->moveto($myelement);
-		sleep(6);
+		sleep(6); // to handle tooltips
 		$myelement->click();
 	}
 
@@ -591,7 +590,16 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
 	}
 
 	function type($name, $value) {
-		$this->byName($name)->value($value);
+		if (preg_match('/^\/\/[a-z]/', $name)) {
+			$myelement = $this->byXpath($name)->value($value);
+		} else {
+			$this->byName($name)->value($value);
+		}
+	}
+
+	function waitForPageToLoad($integer) {
+		//do we need to set something???
+		usleep($integer);
 	}
 }
 

-----------------------------------------------------------------------

Summary of changes:
 tests/func/10_Site/projectsTest.php | 97 +++++++++++++++++++------------------
 tests/func/SeleniumForge.php        | 21 ++++++--
 2 files changed, 67 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list