$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->select("//select[@name='built_from_template']", "label=Start from empty project");
+ $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->url(ROOT."/admin/");
$this->waitForPageToLoad("30000");
- $this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Forge administrators") ;
+ $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->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "toto") ;
<?php
/**
- * Copyright, 2014,2016, Franck Villaume - TrivialDev
+ * Copyright, 2014,2016,2019, Franck Villaume - TrivialDev
* Copyright (C) 2015 Inria (Sylvain Beucler)
*
* This file is part of FusionForge.
$this->assertTextPresent("Added Package");
$this->clickAndWait("link=Administration");
$this->type('//td[2]/input', 'My Named Packaged');
- $this->click('//td[5]/input');
+ $this->clickAndWait('//td[5]/input');
$this->clickAndWait("link=View File Releases");
$this->assertTextPresent('My Named Package');
}
$this->clickAndWait("link=Forums");
$this->assertFalse($this->isTextPresent("Permission denied."));
$this->assertTrue($this->isTextPresent("open-discussion"));
- $this->click("link=open-discussion");
+ $this->clickAndWait("link=open-discussion");
$this->waitForPageToLoad("30000");
- $this->click("link=Start New Thread");
+ $this->clickAndWait("link=Start New Thread");
$this->waitForPageToLoad("30000");
$this->type("subject", "Message1");
$this->type("body", "Text1");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Message Posted Successfully"));
- $this->click("link=Forums");
+ $this->clickAndWait("link=Forums");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("open-discussion"));
- $this->click("link=open-discussion");
+ $this->clickAndWait("link=open-discussion");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Message1"));
}
$this->clickAndWait("link=Forums");
$this->clickAndWait("link=open-discussion");
$this->clickAndWait("link=Welcome to open-discussion");
- $this->click("link=[ Reply ]");
+ $this->clickAndWait("link=[ Reply ]");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isLoginRequired());
$this->triggeredLogin(FORGE_ADMIN_USERNAME);
$this->type("body", "Here is my 19823 reply");
$this->clickAndWait("submit");
$this->assertTextPresent("Message Posted Successfully");
- $this->click("link=Welcome to open-discussion");
+ $this->clickAndWait("link=Welcome to open-discussion");
$this->waitForPageToLoad("30000");
$this->assertTextPresent("Here is my 19823 reply");
$this->switchUser(FORGE_ADMIN_USERNAME);
$this->gotoProject('ProjectA');
- $this->click("link=Mailing Lists");
+ $this->clickAndWait("link=Mailing Lists");
$this->waitForPageToLoad("30000");
- $this->click("//body//main[@id='maindiv']//a[.='Administration']");
+ $this->clickAndWait("//body//main[@id='maindiv']//a[.='Administration']");
$this->waitForPageToLoad("30000");
- $this->click("link=Add Mailing List");
+ $this->clickAndWait("link=Add Mailing List");
$this->waitForPageToLoad("30000");
$this->type("list_name", "toto");
$this->type("//input[@name='description']", "Toto mailing list");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("List Added"));
- $this->click("link=Forums");
+ $this->clickAndWait("link=Forums");
$this->waitForPageToLoad("30000");
- $this->click("//body//main[@id='maindiv']//a[.='Administration']");
+ $this->clickAndWait("//body//main[@id='maindiv']//a[.='Administration']");
$this->waitForPageToLoad("30000");
- $this->click("link=Add Forum");
+ $this->clickAndWait("link=Add Forum");
$this->waitForPageToLoad("30000");
$this->type("forum_name", "toto");
$this->type("//input[@name='description']", "Toto forum");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Error: a mailing list with the same email address already exists"));
}
* Copyright (C) 2008 Alain Peyrat <aljeux@free.fr>
* Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
* Copyright (C) 2015 Inria (Sylvain Beucler)
+ * Copyright 2019, Franck Villaume - TrivialDev
*
* This file is part of FusionForge.
*
$this->gotoProject('ProjectA');
// Create a simple news.
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit");
+ $this->clickAndWait("link=Submit");
$this->waitForPageToLoad("30000");
$this->type("summary", "First news");
$this->type("details", "This is a simple news.");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("First news"));
- $this->click("link=First news");
+ $this->clickAndWait("link=First news");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("First news"));
$this->assertTrue($this->isTextPresent("This is a simple news."));
// Create a second news.
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
- $this->click("link=Submit");
+ $this->clickAndWait("link=Submit");
$this->waitForPageToLoad("30000");
$this->type("summary", "Second news");
$this->type("details", "This is another text");
- $this->click("submit");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
- $this->click("link=News");
+ $this->clickAndWait("link=News");
$this->waitForPageToLoad("30000");
- $this->click("link=Second news");
+ $this->clickAndWait("link=Second news");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Second news"));
$this->assertTrue($this->isTextPresent("This is another text"));
// Check that news are visible in the activity
- // TODO: Not implemented in gforge-4.6
-// $this->click("link=Activity");
-// $this->waitForPageToLoad("30000");
-// $this->assertTextPresent("First news");
-// $this->assertTextPresent("Second news");
+ $this->clickAndWait("link=Activity");
+ $this->waitForPageToLoad("30000");
+ $this->assertTextPresent("First news");
+ $this->assertTextPresent("Second news");
// Check modification of a news.
$this->clickAndWait("link=News");
- $this->click("//a[contains(@href, '" . ROOT . "/news/admin/?group_id=7')]");
+ $this->clickAndWait("//a[contains(@href, '" . ROOT . "/news/admin/?group_id=7')]");
$this->waitForPageToLoad("30000");
$this->clickAndWait("link=Second news");
$this->type("details", "This is another text (corrected)");
$this->clickAndWait("link=Test3");
$this->click("//form[@id='newsadminform']//input[@name='status' and @value=4]");
$this->clickAndWait("submit");
-
}
/**
/**
* Copyright (C) 2010 Alcatel-Lucent
* Copyright (C) 2015 Inria (Sylvain Beucler)
+ * Copyright 2019, Franck Villaume - TrivialDev
*
* This file is part of FusionForge.
*
$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->select($this->byName("question_type"))->selectOptionByLabel("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->select($this->byName("question_type"))->selectOptionByLabel("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->select($this->byName("question_type"))->selectOptionByLabel("Comment Only");
$this->clickAndWait("submit");
$this->type("question", "This is a my fifth question (text field) ?");
- $this->select("question_type", "label=Text Field");
+ $this->select($this->byName("question_type"))->selectOptionByLabel("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->select($this->byName("question_type"))->selectOptionByLabel("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("to_add[]");
+ $this->clickAndWait("//input[@name='to_add[]' and @value='4']");
+ $this->clickAndWait("//input[@name='to_add[]' and @value='2']");
+ $this->clickAndWait("//input[@name='to_add[]' and @value='5']");
+ $this->clickAndWait("//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->clickAndWait("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->clickAndWait("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->clickAndWait("_3");
+ $this->clickAndWait("_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->clickAndWait("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("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("to_add[]");
+ $this->clickAndWait("//input[@name='to_add[]' and @value='8']");
+ $this->clickAndWait("//input[@name='to_add[]' and @value='9']");
$this->clickAndWait("submit");
$this->assertTextPresent("1, 2, 3, 4, 5, 6, 7, 8, 9");
/**
* Copyright (C) 2010-2011 Alain Peyrat - Alcatel-Lucent
* Copyright (C) 2015 Inria (Sylvain Beucler)
+ * Copyright 2019, Franck Villaume - TrivialDev
*
* This file is part of FusionForge.
*
$this->gotoProject('ProjectA');
// Initialize "rep_time_tracking" table
- $this->click("link=Reporting");
+ $this->clickAndWait("link=Reporting");
$this->waitForPageToLoad("30000");
- $this->click("link=Initialize / Rebuild Reporting Tables");
+ $this->clickAndWait("link=Initialize / Rebuild Reporting Tables");
$this->waitForPageToLoad("30000");
- $this->click("im_sure");
- $this->click("submit");
+ $this->clickAndWait("im_sure");
+ $this->clickAndWait("submit");
$this->waitForPageToLoad("30000");
// $this->switchUser('uadmin');
$this->type("summary", "Task1: Hello Paris");
$this->type("details", "Details: Hello Paris");
$this->type("hours", "10");
- $this->click("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
+ $this->clickAndWait("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
$this->waitForPageToLoad("30000");
$this->assertTextPresent("Task Created Successfully");
$this->type("summary", "Task2: Hello France");
$this->type("details", "Details: Hello France");
$this->type("hours", "15");
- $this->click("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
+ $this->clickAndWait("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
$this->waitForPageToLoad("30000");
$this->assertTextPresent("Task Created Successfully");
$this->type("summary", "Task3: Hello World");
$this->type("details", "Details: Hello World");
$this->type("hours", "20");
- $this->click("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
+ $this->clickAndWait("//body//main[@id='maindiv']/form/table/tbody/tr[9]/td/input");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Task Created Successfully"));
}
// Let use close a task to sort by status
$this->clickAndWait("link=exact:Task1: Hello Paris");
- $this->click("status_id");
+ $this->clickAndWait("status_id");
$this->select("status_id", "label=Closed");
$this->clickAndWait("submit");
{
// Set the completing value of a task
$this->select("percent_complete", "label=45%");
- $this->click("//option[@value='45']");
+ $this->clickAndWait("//option[@value='45']");
$this->clickAndWait("submit");
$this->assertTextPresent("Task Updated Successfully");
$this->clickAndWait("link=To Do");
$this->clickAndWait("link=exact:Task3: Hello World");
$this->clickAndWait("link=Delete this task");
- $this->click("confirm_delete");
+ $this->clickAndWait("confirm_delete");
$this->clickAndWait("submit");
$this->assertTextPresent("Task Successfully Deleted");
{
$this->gotoProject("ProjectA");
$this->waitForPageToLoad("30000");
- $this->click("link=Tasks");
+ $this->clickAndWait("link=Tasks");
$this->waitForPageToLoad("30000");
- $this->click("link=To Do");
+ $this->clickAndWait("link=To Do");
$this->waitForPageToLoad("30000");
$this->clickAndWait("link=exact:Task1: Hello Paris");
$this->addSelection("assigned_to[]", "label=ucontrib Lastname");
{
// Display activity report by developer
$this->clickAndWait("link=Reporting");
- $this->select("what", "label=Report by Assignee");
+ $this->select($this->byName("what"))->selectOptionByLabel("Report by Assignee");
$this->clickAndWait("//input[@value='Show']");
$this->assertTextPresent("Tasks By Assignee");
$this->assertTextPresent("ucontrib");
function displayActivityReportBySubproject()
{
// Display activity report by subproject
- $this->select("what", "label=Report by Subproject");
+ $this->select($this->byName("what"))->selectOptionByLabel("Report by Subproject");
$this->clickAndWait("//input[@value='Show']");
$this->assertTextPresent("Tasks By Category");
$this->assertTextPresent("To Do");
function assertTextPresent($string) {
return $this->assertTrue($this->isTextPresent($string));
}
+
+ function check($string) {
+ $myelement = $this->byXpath($string);
+ if (!$myelement->attribute('checked')) {
+ $myelement->click();
+ }
+ }
+
+ function uncheck($string) {
+ $myelement = $this->byXpath($string);
+ if ($myelement->attribute('checked')) {
+ $myelement->click();
+ }
+ }
}
// Local Variables: