* 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
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* ALONE BASIS."
*/
-require_once 'func/Testing/SeleniumGforge.php';
+require_once dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
class CreateNews extends FForge_SeleniumTestCase
{
- function testMyTestCase()
+ function testMonitorProjectNews()
{
- $this->createProject('ProjectA');
+ $this->populateStandardTemplate(array());
+ $this->init();
// Create a simple news.
$this->click("link=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->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->click("//a[contains(@href, '" . BASE . "/news/admin/?group_id=6')]");
- $this->waitForPageToLoad("30000");
- $this->click("link=Second news");
+ $this->clickAndWait("link=News");
+ $this->click("//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->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->click("//a[contains(@href, '". BASE . "/news/admin/?group_id=6')]");
- $this->waitForPageToLoad("30000");
- $this->click("link=Test3");
- $this->waitForPageToLoad("30000");
- $this->click("document.forms[2].status[1]");
- $this->click("submit");
- $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=7')]");
+ $this->waitForPageToLoad("30000");
+ $this->clickAndWait("link=Test3");
+ $this->click("//form[@id='newsadminform']//input[@name='status' and @value=4]");
+ $this->clickAndWait("submit");
}
*/
function testAcBug4100()
{
- $this->createProject('ProjectA');
-
// 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");
}
-
+
/*
* Test multiple post of the news (reload).
* Test skipped due to manual intervention required.
*/
function skiptestPreventMultiplePost()
{
- $this->createProject('ProjectA');
-
// 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", "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");
}
-
+
}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
?>