3 * Copyright (C) 2008 Alain Peyrat <aljeux@free.fr>
4 * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
6 * This file is part of FusionForge.
8 * FusionForge is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published
10 * by the Free Software Foundation; either version 2 of the License,
11 * or (at your option) any later version.
13 * FusionForge is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with FusionForge; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 * Standard Alcatel-Lucent disclaimer for contributing to open source
27 * "The test suite ("Contribution") has not been tested and/or
28 * validated for release as or in products, combinations with products or
29 * other commercial use. Any use of the Contribution is entirely made at
30 * the user's own responsibility and the user can not rely on any features,
31 * functionalities or performances Alcatel-Lucent has attributed to the
34 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
35 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
36 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
37 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
38 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
39 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
40 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
41 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
42 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
46 require_once 'func/Testing/SeleniumGforge.php';
48 class CreateProject extends FForge_SeleniumTestCase
50 // Simple creation of a project by the admin user and
51 // approval of the creation just after.
52 // After creation, project is visible on the main page.
53 function testSimpleCreate()
56 $this->click("link=Log In");
57 $this->waitForPageToLoad("30000");
58 $this->type("form_loginname", "admin");
59 $this->type("form_pw", "myadmin");
60 $this->click("login");
61 $this->waitForPageToLoad("30000");
62 $this->click("link=My Page");
63 $this->waitForPageToLoad("30000");
64 $this->click("link=Register Project");
65 $this->waitForPageToLoad("30000");
66 $this->type("full_name", "ProjectA");
67 $this->type("purpose", "This is a simple description for project A");
68 $this->type("description", "This is the public description for project A.");
69 $this->type("unix_name", "projecta");
70 $this->click("//input[@name='scm' and @value='scmsvn']");
71 $this->click("submit");
72 $this->waitForPageToLoad("30000");
73 $this->assertTrue($this->isTextPresent("Your project has been submitted"));
74 $this->assertTrue($this->isTextPresent("you will receive notification of their decision and further instructions"));
75 $this->click("link=Site Admin");
76 $this->waitForPageToLoad("30000");
77 $this->click("link=Pending (P) (New Project Approval)");
78 $this->waitForPageToLoad("30000");
79 $this->click("document.forms['approve.projecta'].submit");
80 $this->waitForPageToLoad("30000");
81 $this->click("link=Home");
82 $this->waitForPageToLoad("30000");
83 $this->assertTrue($this->isTextPresent("ProjectA"));
84 $this->click("link=ProjectA");
85 $this->waitForPageToLoad("30000");
86 $this->assertTrue($this->isTextPresent("This is the public description for project A."));
87 $this->assertTrue($this->isTextPresent("This project has not yet categorized itself"));
90 function testCharsCreateTestCase()
93 $this->click("link=Log In");
94 $this->waitForPageToLoad("30000");
95 $this->type("form_loginname", "admin");
96 $this->type("form_pw", "myadmin");
97 $this->click("login");
98 $this->waitForPageToLoad("30000");
99 $this->click("link=My Page");
100 $this->waitForPageToLoad("30000");
101 $this->click("link=Register Project");
102 $this->waitForPageToLoad("30000");
103 $this->type("full_name", "Project ' & B");
104 $this->type("purpose", "This is a & été simple description for project B");
105 $this->type("description", "This is & été the public description for project B.");
106 $this->type("unix_name", "projectb");
107 $this->click("//input[@name='scm' and @value='scmsvn']");
108 $this->click("submit");
109 $this->waitForPageToLoad("30000");
110 $this->assertTrue($this->isTextPresent("Your project has been submitted"));
111 $this->assertTrue($this->isTextPresent("you will receive notification of their decision and further instructions"));
112 $this->click("link=Site Admin");
113 $this->waitForPageToLoad("30000");
114 $this->click("link=Pending (P) (New Project Approval)");
115 $this->waitForPageToLoad("30000");
116 $this->click("document.forms['approve.projectb'].submit");
117 $this->waitForPageToLoad("30000");
118 $this->click("link=Home");
119 $this->waitForPageToLoad("30000");
120 $this->assertTrue($this->isTextPresent("Project ' & B"));
121 $this->click("link=Project ' & B");
122 $this->waitForPageToLoad("30000");
123 $this->assertTrue($this->isTextPresent("This is & été the public description for project B."));
125 $this->click("link=Projects");
126 $this->waitForPageToLoad("30000");
127 $this->click("link=Project Tree");
128 $this->waitForPageToLoad("30000");
129 $this->click("link=Project List");
130 $this->waitForPageToLoad("30000");
131 $this->assertTrue($this->isTextPresent("Project ' & B - This is & été the public description for project B."));
132 $this->click("link=My Page");
133 $this->waitForPageToLoad("30000");
134 $this->click("//div[@id='tabber']/ul/li[5]/a");
135 $this->assertFalse($this->isTextPresent("Project ' & B"));
138 // Test removal of project.
139 // TODO: Test not finished as removal does not work.
140 function testRemoveProject()
142 $this->createProject('testal1');
144 $this->click("link=Site Admin");
145 $this->waitForPageToLoad("30000");
146 $this->click("link=Display Full Project List/Edit Projects");
147 $this->waitForPageToLoad("30000");
148 $this->click("link=testal1");
149 $this->waitForPageToLoad("30000");
150 $this->click("link=Permanently Delete Project");
151 $this->waitForPageToLoad("30000");
152 $this->click("sure");
153 $this->click("reallysure");
154 $this->click("reallyreallysure");
155 $this->click("submit");