3 * Copyright (C) 2010-2013 Alain Peyrat - Alcatel-Lucent
4 * Copyright 2010-2011, Franck Villaume - Capgemini
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 along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * Standard Alcatel-Lucent disclaimer for contributing to open source
26 * "The test suite ("Contribution") has not been tested and/or
27 * validated for release as or in products, combinations with products or
28 * other commercial use. Any use of the Contribution is entirely made at
29 * the user's own responsibility and the user can not rely on any features,
30 * functionalities or performances Alcatel-Lucent has attributed to the
33 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
34 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
36 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
37 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
39 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
41 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
45 require_once dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
47 class CreateDocURL extends FForge_SeleniumTestCase
49 function testCreateDocURL()
52 $this->gotoProject('ProjectA');
53 $this->clickAndWait("link=Docs");
54 $this->clickAndWait("addItemDocmanMenu");
55 $this->click("id=tab-new-folder");
56 $this->type("groupname", "docdirectory");
57 $this->clickAndWait("submitaddsubgroup");
58 $this->clickAndWait("addItemDocmanMenu");
59 $this->click("id=tab-new-document");
60 $this->type("title", "My document");
61 $this->type("//input[@name='description']", "L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
62 $this->click("//input[@name='type' and @value='pasteurl']");
63 $this->type("file_url", URL."/terms.php");
64 $this->clickAndWait("submit");
65 $this->assertTextPresent("Document ".URL."/terms.php submitted successfully");
66 $this->assertTextPresent("My document");
67 $this->assertTextPresent("L'année dernière à Noël, 3 < 4, 中国 \" <em>, père & fils");
68 $this->clickAndWait("link=My document");
69 $this->assertTextPresent("These are the terms and conditions under");
71 $this->gotoProject('ProjectA');
72 $this->clickAndWait("link=Docs");
73 $this->clickAndWait("listFileDocmanMenu");
74 $this->clickAndWait("link=docdirectory");
75 $this->clickAndWait("//img[@alt='trashdir']");
76 $this->assertTextPresent("Documents folder docdirectory moved to trash successfully");
79 function testCreateMultipleDocs()
82 $this->gotoProject('ProjectA');
83 $this->clickAndWait("link=Docs");
84 $this->clickAndWait("addItemDocmanMenu");
85 $this->type("title", "My document");
86 $this->type("//input[@name='description']", "My Description");
87 $this->click("//input[@name='type' and @value='pasteurl']");
88 $this->type("file_url", URL."/terms.php");
89 $this->clickAndWait("//input[@name='submit' and @value='Submit Information']");
90 $this->assertTextPresent("Document ".URL."/terms.php submitted successfully");
92 $this->gotoProject('ProjectA');
93 $this->clickAndWait("link=Docs");
94 $this->clickAndWait("addItemDocmanMenu");
95 $this->type("title", " My document ");
96 $this->type("//input[@name='description']", "My Description");
97 $this->click("//input[@name='type' and @value='pasteurl']");
98 $this->type("file_url", URL."/terms.php");
99 $this->clickAndWait("//input[@name='submit' and @value='Submit Information']");
100 $this->assertTextPresent("Document already published in this folder");