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 LoginProcess 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.
55 // Test with a normal login.
57 $this->click("link=Log In");
58 $this->waitForPageToLoad("30000");
59 $this->type("form_loginname", "admin");
60 $this->type("form_pw", "myadmin");
61 $this->click("login");
62 $this->waitForPageToLoad("30000");
63 $this->assertTrue($this->isTextPresent("ACOS Forge Admin"));
64 $this->assertTrue($this->isTextPresent("Log Out"));
67 // Test with an empty password.
69 $this->click("link=Log In");
70 $this->waitForPageToLoad("30000");
71 $this->type("form_loginname", "admin");
72 $this->type("form_pw", "");
73 $this->click("login");
74 $this->waitForPageToLoad("30000");
75 $this->assertTrue($this->isTextPresent("Missing Password Or Users Name"));
76 $this->assertFalse($this->isTextPresent("ACOS Forge Admin"));
77 $this->assertTrue($this->isTextPresent("Log In"));
79 // Test with a wrong password.
81 $this->click("link=Log In");
82 $this->waitForPageToLoad("30000");
83 $this->type("form_loginname", "admin");
84 $this->type("form_pw", "awrongpassword");
85 $this->click("login");
86 $this->waitForPageToLoad("30000");
87 $this->assertTrue($this->isTextPresent("Invalid Password Or User Name"));
88 $this->assertFalse($this->isTextPresent("ACOS Forge Admin"));
89 $this->assertTrue($this->isTextPresent("Log In"));