tests/func/Soap/checks.php -text
tests/func/Soap/login.php -text
tests/func/Soap/usergroup.php -text
+tests/func/Surveys/surveysTest.php -text
tests/func/Tasks/createTaskTest.php -text
tests/func/Testing/DEBSeleniumRemoteSuite.php -text
tests/func/Testing/RPMSeleniumRemoteSuite.php -text
// Create the first message (Message1/Text1).
$this->populateStandardTemplate('forums');
$this->init();
- $this->click("link=Forums");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Forums");
$this->assertFalse($this->isTextPresent("Permission denied."));
$this->assertTrue($this->isTextPresent("open-discussion"));
$this->click("link=open-discussion");
$this->logout();
$this->gotoProject('ProjectA');
- $this->click("link=Forums");
- $this->waitForPageToLoad("30000");
- $this->click("link=open-discussion");
- $this->waitForPageToLoad("30000");
- $this->click("link=Welcome to open-discussion");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Forums");
+ $this->clickAndWait("link=open-discussion");
+ $this->clickAndWait("link=Welcome to Open-Discussion");
$this->click("link=[ reply ]");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isLoginRequired());
$this->triggeredLogin('admin');
$this->type("body", "Here is my 19823 reply");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Message Posted Successfully"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Message Posted Successfully");
$this->click("link=Welcome to open-discussion");
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Here is my 19823 reply"));
+ $this->assertTextPresent("Here is my 19823 reply");
}
class CreateNews extends FForge_SeleniumTestCase
{
- function testMyTestCase()
+ function testMonitorProjectNews()
{
$this->populateStandardTemplate(array());
$this->init();
// TODO: Not implemented in gforge-4.6
// $this->click("link=Activity");
// $this->waitForPageToLoad("30000");
-// $this->assertTrue($this->isTextPresent("First news"));
-// $this->assertTrue($this->isTextPresent("Second news"));
+// $this->assertTextPresent("First news");
+// $this->assertTextPresent("Second news");
// Check modification of a news.
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=News");
$this->click("//a[contains(@href, '" . ROOT . "/news/admin/?group_id=6')]");
$this->waitForPageToLoad("30000");
- $this->click("link=Second news");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Second news");
$this->type("details", "This is another text (corrected)");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=Second news");
- $this->waitForPageToLoad("30000");
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->click("link=Second news");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("This is another text (corrected)"));
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->click("link=Submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Second news");
+ $this->clickAndWait("link=News");
+ $this->clickAndWait("link=Second news");
+ $this->assertTextPresent("This is another text (corrected)");
+ $this->clickAndWait("link=News");
+ $this->clickAndWait("link=Submit");
$this->type("summary", "Test3");
$this->type("details", "Special ' chars \"");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->click("link=Test3");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Special ' chars \""));
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=News");
+ $this->clickAndWait("link=Test3");
+ $this->assertTextPresent("Special ' chars \"");
+ $this->clickAndWait("link=News");
$this->click("//a[contains(@href, '". ROOT . "/news/admin/?group_id=6')]");
$this->waitForPageToLoad("30000");
- $this->click("link=Test3");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Test3");
$this->click("document.forms[2].status[1]");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
}
*/
function testAcBug4100()
{
- $this->init();
-
// Create a simple news.
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->click("link=Submit");
- $this->waitForPageToLoad("30000");
+ $this->init();
+ $this->clickAndWait("link=News");
+ $this->clickAndWait("link=Submit");
$this->type("summary", "Multi line news");
$this->type("details", "<p>line1</p><p>line2</p><p>line3</p><br />hello<p>line5</p>\n");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Multi line news"));
- $this->assertTrue($this->isTextPresent("line1"));
- $this->assertTrue($this->isTextPresent("line2"));
- $this->assertTrue($this->isTextPresent("line3"));
- $this->assertTrue($this->isTextPresent("hello"));
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=News");
+ $this->assertTextPresent("Multi line news");
+ $this->assertTextPresent("line1");
+ $this->assertTextPresent("line2");
+ $this->assertTextPresent("line3");
+ $this->assertTextPresent("hello");
// $this->assertFalse($this->isTextPresent("line5"));
- $this->click("link=Multi line news");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Multi line news"));
- $this->assertTrue($this->isTextPresent("line1"));
- $this->assertTrue($this->isTextPresent("line2"));
- $this->assertTrue($this->isTextPresent("line3"));
- $this->assertTrue($this->isTextPresent("hello"));
- $this->assertTrue($this->isTextPresent("line5"));
+ $this->clickAndWait("link=Multi line news");
+ $this->assertTextPresent("Multi line news");
+ $this->assertTextPresent("line1");
+ $this->assertTextPresent("line2");
+ $this->assertTextPresent("line3");
+ $this->assertTextPresent("hello");
+ $this->assertTextPresent("line5");
}
/*
*/
function skiptestPreventMultiplePost()
{
+ // Create a simple news.
$this->init();
- // Create a simple news.
- $this->click("link=News");
- $this->waitForPageToLoad("30000");
- $this->click("link=Submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=News");
+ $this->clickAndWait("link=Submit");
$this->type("summary", "My ABC news");
$this->type("details", "hello DEF with a long detail.\n");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("News Added."));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("News Added.");
$this->chooseOkOnNextConfirmation();
// Problem, a confirmation window is displayed and I didn't found
// the way to automatically click on the Ok button.
$this->refresh();
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Error - double submit"));
+ $this->assertTextPresent("Error - double submit");
}
}
--- /dev/null
+<?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 dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
+
+class Surveys extends FForge_SeleniumTestCase
+{
+ function testSimpleSurvey()
+ {
+ // Test: Create a simple survey.
+ $this->init();
+
+ $this->clickAndWait("link=Surveys");
+ $this->clickAndWait("link=Administration");
+
+ // Create some questions
+ $this->clickAndWait("link=Add Question");
+ $this->type("question", "This is my first question (radio) ?");
+ $this->clickAndWait("submit");
+ $this->type("question", "This is my second question (text area) ?");
+ $this->select("question_type", "label=Text Area");
+ $this->clickAndWait("submit");
+ $this->type("question", "This is my third question (yes/no) ?");
+ $this->select("question_type", "label=Radio Buttons Yes/No");
+ $this->clickAndWait("submit");
+ $this->type("question", "This is a comment line of text");
+ $this->select("question_type", "label=Comment Only");
+ $this->clickAndWait("submit");
+ $this->type("question", "This is a my fifth question (text field) ?");
+ $this->select("question_type", "label=Text Field");
+ $this->clickAndWait("submit");
+ $this->type("question", "L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
+ $this->select("question_type", "label=Text Field");
+ $this->clickAndWait("submit");
+
+ // Create survey
+ $this->clickAndWait("link=Add Survey");
+ $this->type("survey_title", "My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
+ $this->click("to_add[]");
+ $this->click("//input[@name='to_add[]' and @value='4']");
+ $this->click("//input[@name='to_add[]' and @value='2']");
+ $this->click("//input[@name='to_add[]' and @value='5']");
+ $this->click("//input[@name='to_add[]' and @value='3']");
+ $this->clickAndWait("submit");
+ $this->click("link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
+ $this->waitForPageToLoad("30000");
+ $this->assertTextPresent("This is a my fifth question (text field) ?");
+ $this->assertTextPresent("This is a comment line of text");
+ $this->assertTextPresent("This is my third question (yes/no) ?");
+ $this->assertTextPresent("This is my second question (text area) ?");
+ $this->assertTextPresent("This is my first question (radio) ?");
+ $this->click("//input[@name='_1' and @value='3']");
+ $this->type("_2", "hello");
+ $this->click("_3");
+ $this->click("_5");
+ $this->type("_5", "text");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Administration");
+ $this->clickAndWait("link=Show Results");
+ $this->click("link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
+ $this->waitForPageToLoad("30000");
+ $this->assertTextPresent("Warning - you are about to vote a second time on this survey.");
+ $this->clickAndWait("link=Administration");
+ $this->clickAndWait("link=Show Results");
+ $this->clickAndWait("link=Result");
+ $this->assertTextPresent("YES (1)");
+ $this->assertTextPresent("3 (1)");
+ $this->assertTextPresent("1, 2, 3, 4, 5");
+ // Check that the number of votes is 1
+ $this->assertEquals("1", $this->getText("//div[@id='maindiv']/table/tbody/tr/td[5]"));
+
+ // Now testing by adding new questions to the survey.
+ $this->clickAndWait("link=Surveys");
+ $this->clickAndWait("link=Administration");
+ $this->clickAndWait("link=Add Survey");
+ $this->clickAndWait("link=Add Question");
+ $this->type("question", "Another added question ?");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Add Survey");
+ $this->clickAndWait("link=Edit");
+ $this->click("to_add[]");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Add Survey");
+ $this->type("survey_title", "Q10 ?");
+ $this->clickAndWait("link=Add Question");
+ $this->type("question", "Q8 ?");
+ $this->clickAndWait("submit");
+ $this->type("question", "Q9 ?");
+ $this->clickAndWait("submit");
+ $this->type("question", "Q10 ?");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Add Survey");
+ $this->clickAndWait("link=Edit");
+ $this->click("to_add[]");
+ $this->click("//input[@name='to_add[]' and @value='8']");
+ $this->click("//input[@name='to_add[]' and @value='9']");
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("1, 2, 3, 4, 5, 6, 7, 8, 9");
+
+ // Check that survey is public.
+ $this->logout();
+ $this->gotoProject('ProjectA');
+ $this->clickAndWait("link=Surveys");
+ $this->assertTextPresent("My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
+
+// // Set survey to private
+// $this->login("admin");
+//
+// $this->open("/survey/?group_id=6");
+// $this->clickAndWait("link=Surveys");
+// $this->clickAndWait("link=Administration");
+// $this->clickAndWait("link=Add Survey");
+// $this->clickAndWait("link=Edit");
+// $this->click("//input[@name='is_public' and @value='0']");
+// $this->clickAndWait("submit");
+// // Log out and check no survey is visible
+// $this->clickAndWait("link=Log Out");
+// $this->select("none", "label=projecta");
+// $this->waitForPageToLoad("30000");
+// $this->clickAndWait("link=Surveys");
+// $this->assertTextPresent("No Survey is found");
+//
+// // Check direct access to a survey.
+// $this->open("/survey/survey.php?group_id=6&survey_id=1");
+// $this->waitForPageToLoad("30000");
+// $this->assertFalse($this->isTextPresent("My first survey: L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils"));
+ }
+}
+?>
// $this->switchUser('uadmin');
$this->gotoProject('ProjectA');
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("To Do"));
- $this->assertTrue($this->isTextPresent("Next Release"));
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("No Matching Tasks found"));
- }
+ $this->clickAndWait("link=Tasks");
+ $this->assertTextPresent("To Do");
+ $this->assertTextPresent("Next Release");
+ $this->clickAndWait("link=To Do");
+ $this->assertTextPresent("No Matching Tasks found");
+ }
function createSomeTasks()
{
// Create a first task
- $this->click("link=Add Task");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Add Task");
$this->type("summary", "Task1: Hello Paris");
$this->type("details", "Details: Hello Paris");
$this->type("hours", "10");
$this->click("//body/div[@id='maindiv']/form/table/tbody/tr[9]/td/input");
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task Created Successfully"));
+ $this->assertTextPresent("Task Created Successfully");
// Create a second task
- $this->click("link=Add Task");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Add Task");
$this->type("summary", "Task2: Hello France");
$this->type("details", "Details: Hello France");
$this->type("hours", "15");
$this->click("//body/div[@id='maindiv']/form/table/tbody/tr[9]/td/input");
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task Created Successfully"));
+ $this->assertTextPresent("Task Created Successfully");
// Create a third task
- $this->click("link=Add Task");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Add Task");
$this->type("summary", "Task3: Hello World");
$this->type("details", "Details: Hello World");
$this->type("hours", "20");
function browseTasks()
{
// Let us check that the 3 tasks appear on the list of tasks
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1: Hello Paris"));
- $this->assertTrue($this->isTextPresent("Task2: Hello France"));
- $this->assertTrue($this->isTextPresent("Task3: Hello World"));
+ $this->clickAndWait("link=Tasks");
+ $this->clickAndWait("link=To Do");
+ $this->assertTextPresent("Task1: Hello Paris");
+ $this->assertTextPresent("Task2: Hello France");
+ $this->assertTextPresent("Task3: Hello World");
// Let us assign tasks to users so that we can filter by assignee
- $this->click("link=exact:Task1: Hello Paris");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=exact:Task1: Hello Paris");
$this->removeSelection("assigned_to[]", "label=None");
$this->addSelection("assigned_to[]", "label=ucoredev Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=exact:Task2: Hello France");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=exact:Task2: Hello France");
$this->removeSelection("assigned_to[]", "label=None");
$this->addSelection("assigned_to[]", "label=ucontrib Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=exact:Task3: Hello World");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=exact:Task3: Hello World");
$this->removeSelection("assigned_to[]", "label=None");
$this->addSelection("assigned_to[]", "label=ucontrib Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
// There should not be unassigned tasks
$this->select("_assigned_to", "label=Unassigned");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("No Matching Tasks found"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("No Matching Tasks found");
// Tasks 2 and 3 should be assigned to ucontrib
$this->select("_assigned_to", "label=ucontrib Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task2:"));
- $this->assertTrue($this->isTextPresent("Task3:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task2:");
+ $this->assertTextPresent("Task3:");
// Task 1 should be assigned to ucoredev
$this->select("_assigned_to", "label=ucoredev Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
// "Any" should show the 3 tasks
$this->select("_assigned_to", "label=Any");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
- $this->assertTrue($this->isTextPresent("Task2:"));
- $this->assertTrue($this->isTextPresent("Task3:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
+ $this->assertTextPresent("Task2:");
+ $this->assertTextPresent("Task3:");
// Let use close a task to sort by status
- $this->click("link=exact:Task1: Hello Paris");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=exact:Task1: Hello Paris");
$this->click("status_id");
$this->select("status_id", "label=Closed");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
// Select open tasks
$this->select("_status", "label=Open");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task2:"));
- $this->assertTrue($this->isTextPresent("Task3:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task2:");
+ $this->assertTextPresent("Task3:");
// Select closed tasks
$this->select("_status", "label=Closed");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
// Select "Any" status
$this->select("_status", "label=Any");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
- $this->assertTrue($this->isTextPresent("Task2:"));
- $this->assertTrue($this->isTextPresent("Task3:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
+ $this->assertTextPresent("Task2:");
+ $this->assertTextPresent("Task3:");
// Let us add categories to sort by category
- $this->click("link=Admin");
- $this->waitForPageToLoad("30000");
- $this->click("link=Add/Edit Categories");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Admin");
+ $this->clickAndWait("link=Add/Edit Categories");
$this->type("name", "mycategory");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Category Inserted"));
+ $this->clickAndWait("post_changes");
+ $this->assertTextPresent("Category Inserted");
$this->type("name", "yourcategory");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Category Inserted"));
- $this->assertTrue($this->isTextPresent("mycategory"));
- $this->assertTrue($this->isTextPresent("yourcategory"));
+ $this->clickAndWait("post_changes");
+ $this->assertTextPresent("Category Inserted");
+ $this->assertTextPresent("mycategory");
+ $this->assertTextPresent("yourcategory");
// Set Task1 to mycategory
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->click("link=exact:Task1: Hello Paris");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=To Do");
+ $this->clickAndWait("link=exact:Task1: Hello Paris");
$this->select("category_id", "label=mycategory");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
// Set Task2 to yourcategory
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->click("link=exact:Task2: Hello France");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=To Do");
+ $this->clickAndWait("link=exact:Task2: Hello France");
$this->select("category_id", "label=yourcategory");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
// Select "Any" category
$this->select("_category_id", "label=Any");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
$this->select("_order", "label=Task Summary");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
- $this->assertTrue($this->isTextPresent("Task2:"));
- $this->assertTrue($this->isTextPresent("Task3:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
+ $this->assertTextPresent("Task2:");
+ $this->assertTextPresent("Task3:");
// Select "mycategory" category
$this->select("_category_id", "label=mycategory");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1:"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task1:");
$this->assertFalse($this->isTextPresent("Task2:"));
$this->assertFalse($this->isTextPresent("Task3:"));
// Select "yourcategory" category
$this->select("_category_id", "label=yourcategory");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
$this->assertFalse($this->isTextPresent("Task1:"));
- $this->assertTrue($this->isTextPresent("Task2:"));
+ $this->assertTextPresent("Task2:");
$this->assertFalse($this->isTextPresent("Task3:"));
// Set Detail view to Detailed
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=To Do");
$this->select("_category_id", "label=Any");
$this->select("_view", "label=Detailed");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Details: Hello Paris"));
- $this->assertTrue($this->isTextPresent("Details: Hello France"));
- $this->assertTrue($this->isTextPresent("Details: Hello World"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Details: Hello Paris");
+ $this->assertTextPresent("Details: Hello France");
+ $this->assertTextPresent("Details: Hello World");
// Set Detail view to Summary
$this->select("_view", "label=Summary");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
$this->assertFalse($this->isTextPresent("Details: Hello"));
}
function setTaskPriority()
{
// Set the priority of a task
- $this->click("link=exact:Task2: Hello France");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=exact:Task2: Hello France");
$this->select("priority", "label=5 - Highest");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
// Check the priority is OK
- $this->click("link=exact:Task2: Hello France");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Highest"));
+ $this->clickAndWait("link=exact:Task2: Hello France");
+ $this->assertTextPresent("Highest");
}
function completeTask()
// Set the completing value of a task
$this->select("percent_complete", "label=45%");
$this->click("//option[@value='45']");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task Updated Successfully"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task Updated Successfully");
// Check the percentage is OK
- $this->click("link=exact:Task2: Hello France");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("45%"));
+ $this->clickAndWait("link=exact:Task2: Hello France");
+ $this->assertTextPresent("45%");
}
function closeTask()
function deleteTask()
{
// Delete a task
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->click("link=exact:Task3: Hello World");
- $this->waitForPageToLoad("30000");
- $this->click("link=Delete this task");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=To Do");
+ $this->clickAndWait("link=exact:Task3: Hello World");
+ $this->clickAndWait("link=Delete this task");
$this->click("confirm_delete");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task Successfully Deleted"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Task Successfully Deleted");
// Let us check that Task3 no longer appears on the list of tasks
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Task1: Hello Paris"));
- $this->assertTrue($this->isTextPresent("Task2: Hello France"));
+ $this->clickAndWait("link=Tasks");
+ $this->clickAndWait("link=To Do");
+ $this->assertTextPresent("Task1: Hello Paris");
+ $this->assertTextPresent("Task2: Hello France");
$this->assertFalse($this->isTextPresent("Task3: Hello World"));
}
function assignTask()
{
- $this->gotoProject("ProjectA");
- $this->waitForPageToLoad("30000");
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->click("link=To Do");
+ $this->gotoProject("ProjectA");
$this->waitForPageToLoad("30000");
- $this->click("link=exact:Task1: Hello Paris");
+ $this->click("link=Tasks");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=To Do");
$this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=exact:Task1: Hello Paris");
$this->addSelection("assigned_to[]", "label=ucontrib Lastname");
$this->removeSelection("assigned_to[]", "label=ucoredev Lastname");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("submit");
$this->switchUser('ucontrib');
$this->open( ROOT );
$this->waitForPageToLoad("30000");
- $this->click("link=ProjectA");
- $this->waitForPageToLoad("30000");
- $this->click("link=My Page");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=ProjectA");
+ $this->clickAndWait("link=My Page");
// You cannot click on "Assigned Tasks" tabs,
// but the text is present in the page anyway.
// $this->click("link=Assigned Tasks");
- $this->assertTrue($this->isTextPresent("Task2: Hello France"));
+ $this->assertTextPresent("Task2: Hello France");
$this->switchUser('uadmin');
$this->open( ROOT );
$this->waitForPageToLoad("30000");
function createSubproject()
{
- $this->gotoProject("ProjectA");
- $this->waitForPageToLoad("30000");
- $this->click("link=Project Admin");
- $this->waitForPageToLoad("30000");
- $this->click("link=Tools");
- $this->waitForPageToLoad("30000");
- $this->click("link=Task Manager Admin");
- $this->waitForPageToLoad("30000");
- $this->click("link=Add a Subproject");
- $this->waitForPageToLoad("30000");
+ $this->gotoProject("ProjectA");
+ $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Project Admin");
+ $this->clickAndWait("link=Tools");
+ $this->clickAndWait("link=Tasks Admin");
+ $this->clickAndWait("link=Add a Subproject");
$this->type("project_name", "public");
$this->type("description", "This is a public subproject");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Subproject Inserted"));
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("This is a public subproject"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Subproject Inserted");
+ $this->clickAndWait("link=Tasks");
+ $this->assertTextPresent("This is a public subproject");
}
function createPrivateSubproject()
{
- $this->gotoProject("ProjectA");
- $this->waitForPageToLoad("30000");
- $this->click("link=Project Admin");
- $this->waitForPageToLoad("30000");
- $this->click("link=Tools");
- $this->waitForPageToLoad("30000");
- $this->click("link=Task Manager Admin");
- $this->waitForPageToLoad("30000");
- $this->click("link=Add a Subproject");
+ $this->gotoProject("ProjectA");
$this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Project Admin");
+ $this->clickAndWait("link=Tools");
+ $this->clickAndWait("link=Tasks Admin");
+ $this->clickAndWait("link=Add a Subproject");
$this->click("//input[@name='is_public' and @value='0']");
$this->type("project_name", "private");
$this->type("description", "This is a private subproject");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Subproject Inserted"));
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("This is a private subproject"));
+ $this->clickAndWait("submit");
+ $this->assertTextPresent("Subproject Inserted");
+ $this->clickAndWait("link=Tasks");
+ $this->assertTextPresent("This is a private subproject");
}
function displayGANTT()
{
// Display GANTT diagram
- $this->click("link=Tasks");
- $this->waitForPageToLoad("30000");
- $this->click("link=To Do");
- $this->waitForPageToLoad("30000");
+ $this->open("/pm/reporting/index.php?what=tech&span=&period=lifespan&group_id=6#b");
+ $this->clickAndWait("link=Tasks");
+ $this->clickAndWait("link=To Do");
$this->click("link=Gantt Chart");
$this->waitForPopUp("Gantt_Chart", "30000");
}
function displayActivityReportByDeveloper()
{
// Display activity report by developer
- $this->click("link=Reporting");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Reporting");
$this->select("what", "label=Report by Assignee");
- $this->click("//input[@value='Show']");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Tasks By Assignee"));
- $this->assertTrue($this->isTextPresent("ucontrib"));
+ $this->clickAndWait("//input[@value='Show']");
+ $this->assertTextPresent("Tasks By Assignee");
+ $this->assertTextPresent("ucontrib");
$this->assertFalse($this->isTextPresent("ucoredev"));
}
{
// Display activity report by subproject
$this->select("what", "label=Report by Subproject");
- $this->click("//input[@value='Show']");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Tasks By Category"));
- $this->assertTrue($this->isTextPresent("To Do"));
+ $this->clickAndWait("//input[@value='Show']");
+ $this->assertTextPresent("Tasks By Category");
+ $this->assertTextPresent("To Do");
}
function exportCSV()
$this->assertTrue($this->isTextPresent("Description1"));
// Test: Adding a comment and checking that it is recorded.
- $this->type("details", "This is comment 1");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=Summary1");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("This is comment 1"));
+ $this->type("details", 'This is comment 1');
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Summary1");
+ $this->assertTextPresent('This is comment 1');
// Test: Adding a second comment and checking that it is recorded.
- $this->type("details", "Comment 2 added");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=Summary1");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Comment 2 added"));
- $this->assertTrue($this->isTextPresent("This is comment 1"));
+ $this->type("details", 'Comment 2 \n added');
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Summary1");
+ $this->assertTextPresent('Comment 2 \n added');
+ $this->assertTextPresent("This is comment 1");
// Test: Adding another comment (chars) and checking that it is recorded.
$this->type("details", "This & été");
- $this->click("submit");
- $this->waitForPageToLoad("30000");
- $this->click("link=Summary1");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("This & été"));
+ $this->clickAndWait("submit");
+ $this->clickAndWait("link=Summary1");
+ $this->assertTextPresent("This & été");
// Test: Updating the URL extra field and checking that it is recorded.
$this->type("//form[@id='trackermodform']//input[@type='text']", "http://google.com/");
$this->click("//tr[@id='field-number']/td[4]/a[1]");
$this->waitForPageToLoad("30000");
$this->type("name", "1");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Element inserted"));
+ $this->clickAndWait("post_changes");
+ $this->assertTextPresent("Element inserted");
$this->type("name", "2");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("Element inserted"));
+ $this->clickAndWait("post_changes");
+ $this->assertTextPresent("Element inserted");
// Testing [#3609]: Select Box does not accept 0 as choice
$this->type("name", "0");
{
function testWorkflow()
{
+ // Testing extra-fields
$this->populateStandardTemplate('trackers');
$this->init();
- // Testing extra-fields
- $this->click("link=Tracker");
- $this->waitForPageToLoad("30000");
- $this->click("link=Bugs");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Tracker");
+ $this->clickAndWait("link=Bugs");
$this->click("//a[contains(@href, '".ROOT. "/tracker/admin/')]");
$this->waitForPageToLoad("30000");
- $this->click("link=Manage Custom Fields");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Manage Custom Fields");
$this->type("name", "MyStatus");
$this->type("alias", "mystatus");
$this->click("document.forms[2].field_type[6]");
$this->click("//tr[@id='field-mystatus']/td[4]/a[1]");
$this->waitForPageToLoad("30000");
$this->type("name", "Open");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Resolved");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Validated");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Verified");
$this->select("status_id", "label=Closed");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Duplicated");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Postponed");
- $this->click("post_changes");
- $this->waitForPageToLoad("30000");
+ $this->clickAndWait("post_changes");
$this->type("name", "Closed");
$this->select("status_id", "label=Closed");
$this->click("post_changes");