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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 require_once 'func/Testing/SeleniumGforge.php';
24 class Trove extends FForge_SeleniumTestCase
26 function testTroveAdmin()
29 $this->login(FORGE_ADMIN_USERNAME);
30 $this->click("link=Site Admin");
31 $this->waitForPageToLoad("30000");
32 $this->click("link=Display Trove Map");
33 $this->waitForPageToLoad("30000");
35 // Test simple modification of an entry (beta => beta2)
36 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
37 $this->waitForPageToLoad("30000");
38 $this->type("form_shortname", "beta2");
39 $this->type("form_fullname", "4 - Beta2");
40 $this->type("form_description", "Resource2 is in late phases of development. Deliverables are essentially complete, but may still have significant bugs.");
41 $this->click("submit");
42 $this->waitForPageToLoad("30000");
43 $this->assertTrue($this->isTextPresent("4 - Beta2"));
45 // Test removal of an entry (beta2) (leaf)
46 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=10')]");
47 $this->waitForPageToLoad("30000");
48 $this->click("delete");
49 $this->waitForPageToLoad("30000");
50 $this->assertFalse($this->isTextPresent("4 - Beta2"));
52 // Test creation of a new entry (test)
53 $this->click("link=Site Admin");
54 $this->waitForPageToLoad("30000");
55 $this->click("link=Add to the Trove Map");
56 $this->waitForPageToLoad("30000");
57 $this->type("form_shortname", "Test");
58 $this->type("form_fullname", "Test");
59 $this->type("form_description", "This is a test");
60 $this->click("submit");
61 $this->waitForPageToLoad("30000");
62 $this->assertTrue($this->isTextPresent("Test"));
64 // Test removal of a non empty entry (Microsoft).
65 $this->click("//a[contains(@href, 'trove_cat_edit.php?trove_cat_id=214')]");
66 $this->waitForPageToLoad("30000");
67 $this->click("delete");
68 $this->waitForPageToLoad("30000");
69 $this->assertTrue($this->isTextPresent("Test"));
70 $this->assertFalse($this->isTextPresent("Microsoft"));
76 // c-file-style: "bsd"