[Fusionforge-commits] FusionForge branch master updated. v6.1-202-g56b5099

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Jan 20 18:47:28 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  56b5099a5b98fb0f1632e486e6429f4502d3a819 (commit)
       via  20b9aba15659e0422e303c01a2068e885f9d9c53 (commit)
       via  6bbbc33efd0631525334e1e09a6691ddf6b8c8bc (commit)
      from  afe94409ed37640745584d250a1586bb483af96f (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=56b5099a5b98fb0f1632e486e6429f4502d3a819

commit 56b5099a5b98fb0f1632e486e6429f4502d3a819
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Jan 20 18:47:06 2019 +0100

    add support byId in type function, byCss in clickAndWait

diff --git a/tests/func/SeleniumForge.php b/tests/func/SeleniumForge.php
index 3358b15..170c4ed 100644
--- a/tests/func/SeleniumForge.php
+++ b/tests/func/SeleniumForge.php
@@ -197,6 +197,9 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
 		} else if (preg_match('/^id=/', $link)) {
 			$id = substr($link, 3);
 			$myelement = $this->byId($id);
+		} else if (preg_match('/^css=/', $link)) {
+			$css = substr($link, 4);
+			$myelement = $this->byCss($css);
 		} else if (preg_match('/^\/\/[a-z]/', $link)) {
 			$myelement = $this->byXPath($link);
 		} else {
@@ -612,7 +615,9 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_Selenium2TestCase
 
 	function type($name, $value) {
 		if (preg_match('/^\/\/[a-z]/', $name)) {
-			$myelement = $this->byXPath($name)->value($value);
+			$this->byXPath($name)->value($value);
+		} else if (preg_match('/^id=/', $name)) {
+			$this->byId(substr($name, 3))->value($value);
 		} else {
 			$this->byName($name)->value($value);
 		}

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

commit 20b9aba15659e0422e303c01a2068e885f9d9c53
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Jan 20 18:16:48 2019 +0100

    add missing id

diff --git a/tests/func/20_Docs/createDocURLTest.php b/tests/func/20_Docs/createDocURLTest.php
index de862cd..06d93e0 100644
--- a/tests/func/20_Docs/createDocURLTest.php
+++ b/tests/func/20_Docs/createDocURLTest.php
@@ -55,13 +55,13 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		// ugly hack until we fix behavior in docman when no folders exist. We need to click twice on the link
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->clickAndWait("id=tabs-new-folder");
 		$this->type("groupname", "docdirectory");
-		$this->clickAndWait("submitaddsubgroup");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=submitaddsubgroup");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->clickAndWait("id=tabs-new-document");
 		$this->type("title", "My document");
 		$this->type("//textarea[@name='description']", "L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
@@ -76,7 +76,7 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("listFileDocmanMenu");
+		$this->clickAndWait("id=listFileDocmanMenu");
 		$this->clickAndWait("link=docdirectory");
 		$this->clickAndWait("//img[@alt='trashdir']");
 		$this->assertTextPresent("Documents folder docdirectory moved to trash successfully");
@@ -88,9 +88,9 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		// ugly hack until we fix behavior in docman when no folders exist. We need to click twice on the link
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->clickAndWait("id=tab-new-document");
 		$this->type("title", "My document");
 		$this->type("//textarea[@name='description']", "My Description");
@@ -102,7 +102,7 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->type("title", " My document ");
 		$this->type("//textarea[@name='description']", "My Description");
 		$this->clickAndWait("//input[@name='type' and @value='pasteurl']");
@@ -117,9 +117,9 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		// ugly hack until we fix behavior in docman when no folders exist. We need to click twice on the link
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->clickAndWait("id=tab-new-document");
 		$this->type("title", "My document");
 		$this->type("//textarea[@name='description']", "My Description");
@@ -127,7 +127,7 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 		$this->type("file_url", URL."/terms.php");
 		$this->clickAndWait("//input[@name='submit' and @value='Submit Information']");
 		$this->assertTextPresent("Document ".URL."/terms.php submitted successfully");
-		$this->clickAndWait("listFileDocmanMenu");
+		$this->clickAndWait("id=listFileDocmanMenu");
 		$this->clickAndWait("link=Uncategorized Submissions");
 		$this->clickAndWait("css=img[alt='editdocument']");
 		$this->pause("10000");
@@ -144,9 +144,9 @@ class CreateDocURL extends FForge_SeleniumTestCase {
 
 		$this->gotoProject('ProjectA');
 		$this->clickAndWait("link=Docs");
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		// ugly hack until we fix behavior in docman when no folders exist. We need to click twice on the link
-		$this->clickAndWait("addItemDocmanMenu");
+		$this->clickAndWait("id=addItemDocmanMenu");
 		$this->clickAndWait("id=tab-new-document");
 		$this->type("title", "My document");
 		$this->type("//textarea[@name='description']", "My Description");

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

commit 6bbbc33efd0631525334e1e09a6691ddf6b8c8bc
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Jan 20 18:14:03 2019 +0100

    speed up tests

diff --git a/tests/func/10_Site/projectsTest.php b/tests/func/10_Site/projectsTest.php
index 2fb030b..00d713f 100644
--- a/tests/func/10_Site/projectsTest.php
+++ b/tests/func/10_Site/projectsTest.php
@@ -55,9 +55,9 @@ class CreateProject extends FForge_SeleniumTestCase
 		// "Manual" procedure
 		$this->login (FORGE_ADMIN_USERNAME);
 		$this->url(ROOT."/my/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Register Project");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Project Full Name"));
 		$this->type("full_name", "ProjectA");
 		$this->type("purpose", "This is a simple description for ProjectA");
@@ -66,13 +66,13 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->clickAndWait("//input[@name='scm' and @value='scmsvn']");
 		$this->assertTrue($this->isElementPresent("//select[@name='built_from_template']"));
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
 		$this->url(ROOT);
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("ProjectA"));
 		$this->clickAndWait("link=ProjectA");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectA."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
 	}
@@ -81,33 +81,33 @@ class CreateProject extends FForge_SeleniumTestCase
 	{
 		$this->login(FORGE_ADMIN_USERNAME);
 		$this->url(ROOT."/my/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Register Project");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$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->clickAndWait("//input[@name='scm' and @value='scmsvn']");
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
 		$this->url(ROOT);
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Project ' & B"));
 		$this->clickAndWait("link=Project ' & B");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("This is & été the public description for project B."));
 
 		$this->url(ROOT."/projects");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Project Tree");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Project List");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Project ' & B - This is & été the public description for project B."));
 		$this->url(ROOT."/my/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertFalse($this->isTextPresent("Project ' & B"));
 	}
 
@@ -116,10 +116,10 @@ class CreateProject extends FForge_SeleniumTestCase
 		// Test our high-level functions (testing the test-suite)
 		$this->createProject ('ProjectB');
 		$this->url(ROOT);
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("ProjectB"));
 		$this->clickAndWait("link=ProjectB");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectB."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
 		$this->gotoProject ('ProjectB');
@@ -135,36 +135,36 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->populateStandardTemplate('trackers');
 
 		$this->open( ROOT . '/projects/tmpl') ;
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 
 		$this->clickAndWait("link=Admin");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Tools");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Trackers Administration");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->type("name", "Local tracker for UNIXNAME");
 		$this->type("//input[@name='description']", "Tracker for PUBLICNAME (UNIXNAME)");
 		$this->clickAndWait("post_changes");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Tracker created successfully"));
 
 		$this->init();
 		$this->clickAndWait("link=Tracker");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Tracker for ProjectA (projecta)"));
 
 		// Test for fusionforge.org bug #245
 		$this->open( ROOT . '/projects/tmpl') ;
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 
 		$this->clickAndWait("link=Admin");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Tools");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->uncheck("//input[@name='use_tracker']") ;
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 
 		$this->createAndGoto('ProjectB');
 	}
@@ -175,9 +175,9 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->populateStandardTemplate('all');
 
 		$this->url(ROOT."/my/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Register Project");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isElementPresent("//select[@name='built_from_template']"));
 		$this->type("full_name", "ProjectA");
 		$this->type("purpose", "This is a simple description for ProjectA");
@@ -186,13 +186,13 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->select($this->byXPath("//select[@name='built_from_template']"))->selectOptionByLabel("Start from empty project");
 		$this->clickAndWait("//input[@name='scm' and @value='scmsvn']");
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Your project has been automatically approved"));
 		$this->url(ROOT);
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("ProjectA"));
 		$this->clickAndWait("link=ProjectA");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("This is the public description for ProjectA."));
 		$this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
 		$this->assertFalse($this->isElementPresent("link=Tracker"));
@@ -211,32 +211,32 @@ class CreateProject extends FForge_SeleniumTestCase
 		$this->createUser('toto');
 
 		$this->url(ROOT."/admin/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->select($this->byXPath("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']"))->selectOptionByLabel("Forge administrators") ;
 		$this->clickAndWait("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "toto") ;
 		$this->clickAndWait("//input[@value='Add User']") ;
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("toto Lastname"));
 
 		$this->registerProject('testal1','toto');
 
 		$this->url(ROOT."/admin/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Display Full Project List/Edit Projects");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=testal1");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Permanently Delete Project");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("sure");
 		$this->clickAndWait("reallysure");
 		$this->clickAndWait("reallyreallysure");
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->url(ROOT);
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertFalse($this->isTextPresent("testal1"));
 
 		// Non-regression test for bug #681
diff --git a/tests/func/10_Site/troveTest.php b/tests/func/10_Site/troveTest.php
index 750fbdc..af1290c 100644
--- a/tests/func/10_Site/troveTest.php
+++ b/tests/func/10_Site/troveTest.php
@@ -29,44 +29,44 @@ class Trove extends FForge_SeleniumTestCase
 		$this->open( ROOT );
 		$this->login(FORGE_ADMIN_USERNAME);
 		$this->url(ROOT."/admin/");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Display Trove Map");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 
 		// Test simple modification of an entry (beta => beta2)
 		$this->clickAndWait("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->type("form_shortname", "beta2");
 		$this->type("form_fullname", "4 - Beta2");
 		$this->type("form_description", "Resource2 is in late phases of development. Deliverables are essentially complete, but may still have significant bugs.");
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("4 - Beta2"));
 
 		// Test removal of an entry (beta2) (leaf)
 		$this->clickAndWait("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("delete");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertFalse($this->isTextPresent("4 - Beta2"));
 
 		// Test creation of a new entry (test)
 		$this->clickAndWait("link=Site Admin");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("link=Add to the Trove Map");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->type("form_shortname", "Test");
 		$this->type("form_fullname", "Test");
 		$this->type("form_description", "This is a test");
 		$this->clickAndWait("submit");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Test"));
 
 		// Test removal of a non empty entry (Microsoft).
 		$this->clickAndWait("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=214')]");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->clickAndWait("delete");
-		$this->waitForPageToLoad("30000");
+		$this->waitForPageToLoad();
 		$this->assertTrue($this->isTextPresent("Test"));
 		$this->assertFalse($this->isTextPresent("Microsoft"));
 	}

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

Summary of changes:
 tests/func/10_Site/projectsTest.php     | 80 ++++++++++++++++-----------------
 tests/func/10_Site/troveTest.php        | 22 ++++-----
 tests/func/20_Docs/createDocURLTest.php | 26 +++++------
 tests/func/SeleniumForge.php            |  7 ++-
 4 files changed, 70 insertions(+), 65 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list