3 * Copyright (C) 2009 Alain Peyrat <aljeux@free.fr>
5 * This file is part of FusionForge.
7 * FusionForge is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License,
10 * or (at your option) any later version.
12 * FusionForge is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with FusionForge; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 require_once 'func/Testing/SeleniumGforge.php';
25 class Trove extends FForge_SeleniumTestCase
27 function testTroveAdmin()
30 $this->login('admin');
31 $this->click("link=Admin");
32 $this->waitForPageToLoad("30000");
33 $this->click("link=Display Trove Map");
34 $this->waitForPageToLoad("30000");
36 // Test simple modification of an entry (beta => beta2)
37 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
38 $this->waitForPageToLoad("30000");
39 $this->type("form_shortname", "beta2");
40 $this->type("form_fullname", "4 - Beta2");
41 $this->type("form_description", "Resource2 is in late phases of development. Deliverables are essentially complete, but may still have significant bugs.");
42 $this->click("submit");
43 $this->waitForPageToLoad("30000");
44 $this->assertTrue($this->isTextPresent("4 - Beta2"));
46 // Test removal of an entry (beta2) (leaf)
47 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
48 $this->waitForPageToLoad("30000");
49 $this->click("delete");
50 $this->waitForPageToLoad("30000");
51 $this->assertFalse($this->isTextPresent("4 - Beta2"));
53 // Test creation of a new entry (test)
54 $this->click("link=Admin");
55 $this->waitForPageToLoad("30000");
56 $this->click("link=Add to the Trove Map");
57 $this->waitForPageToLoad("30000");
58 $this->type("form_shortname", "Test");
59 $this->type("form_fullname", "Test");
60 $this->type("form_description", "This is a test");
61 $this->click("submit");
62 $this->waitForPageToLoad("30000");
63 $this->assertTrue($this->isTextPresent("Test"));
65 // Test removal of a non empty entry (Microsoft).
66 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=214')]");
67 $this->waitForPageToLoad("30000");
68 $this->click("delete");
69 $this->waitForPageToLoad("30000");
70 $this->assertTrue($this->isTextPresent("Test"));
71 $this->assertFalse($this->isTextPresent("Microsoft"));