3 * Copyright (C) 2010 Alcatel-Lucent
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
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 'func/Testing/SeleniumGforge.php';
47 class UserBlocks extends FForge_SeleniumTestCase
49 protected $alreadyActive = 0;
51 function testUserBlocks()
53 $this->_activateBlocksPlugin();
57 $this->click("link=Admin");
58 $this->waitForPageToLoad("30000");
59 $this->click("link=Tools");
60 $this->waitForPageToLoad("30000");
61 $this->click("use_blocksplugin");
62 $this->click("submit");
63 $this->waitForPageToLoad("30000");
64 $this->assertTrue($this->isTextPresent("Project information updated"));
65 $this->click("link=Blocks Admin");
66 $this->waitForPageToLoad("30000");
67 $this->click("activate[summary_description]");
68 $this->click("activate[summary_right]");
69 $this->click("//input[@value='Save Blocks']");
70 $this->waitForPageToLoad("30000");
72 $this->open("/plugins/blocks/index.php?id=6&type=admin&pluginname=blocks");
73 $this->click("link=configure");
74 $this->waitForPageToLoad("30000");
75 $this->type("body", "This is my nice block.");
76 $this->click("//input[@value='Save']");
77 $this->waitForPageToLoad("30000");
78 $this->click("//div[@id='maindiv']/form/table/tbody/tr[2]/td[4]/a");
79 $this->waitForPageToLoad("30000");
80 $this->type("body", "{boxTop Project}\nThis is the summary block.\n{boxBottom}");
81 $this->click("//input[@value='Save']");
82 $this->waitForPageToLoad("30000");
83 $this->click("link=Summary");
84 $this->waitForPageToLoad("30000");
85 // $this->assertText("//td[@id='main']/table[1]/tbody/tr/td[1]", "This is my nice block.");
86 // $this->assertEquals("This is the summary block.", $this->getText("//td[@id='main']/table[1]/tbody/tr/td[2]/table[1]/tbody/tr[2]/td"));
87 $this->assertTrue($this->isTextPresent("This is my nice block."));
88 $this->assertTrue($this->isTextPresent("This is the summary block."));
91 private function _activateBlocksPlugin() {
92 if (! $this->alreadyActive) {
93 $this->activatePlugin('blocks');
94 $this->alreadyActive = 1;