3 * Copyright (C) 2008 Alain Peyrat <aljeux@free.fr>
4 * Copyright (C) 2009 - 2010 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 dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
48 class CreateTrackerWorkflow extends FForge_SeleniumTestCase
50 function testWorkflow()
52 // Testing extra-fields
53 $this->populateStandardTemplate('trackers');
56 $this->clickAndWait("link=Tracker");
57 $this->clickAndWait("link=Bugs");
58 $this->click("//a[contains(@href, '".ROOT. "/tracker/admin/')]");
59 $this->waitForPageToLoad("30000");
60 $this->clickAndWait("link=Manage Custom Fields");
61 $this->type("name", "MyStatus");
62 $this->type("alias", "mystatus");
63 $this->click("document.forms[2].field_type[6]");
64 $this->click("post_changes");
65 $this->waitForPageToLoad("30000");
66 $this->click("//tr[@id='field-mystatus']/td[3]/a[1]");
67 $this->waitForPageToLoad("30000");
68 $this->type("name", "New");
69 $this->click("post_changes");
70 $this->waitForPageToLoad("30000");
71 $this->click("link=Manage Custom Fields");
72 $this->waitForPageToLoad("30000");
73 $this->click("//tr[@id='field-mystatus']/td[3]/a[3]");
74 $this->waitForPageToLoad("30000");
75 $this->type("name", "Analyse");
76 $this->select("status_id", "label=Open");
77 $this->click("post_changes");
78 $this->waitForPageToLoad("30000");
79 $this->click("link=Manage Workflow");
80 $this->waitForPageToLoad("30000");
81 $this->click("link=Manage Custom Fields");
82 $this->waitForPageToLoad("30000");
83 $this->click("//tr[@id='field-mystatus']/td[4]/a[1]");
84 $this->waitForPageToLoad("30000");
85 $this->type("name", "Candidate");
86 $this->click("post_changes");
87 $this->waitForPageToLoad("30000");
88 $this->click("link=Manage Custom Fields");
89 $this->waitForPageToLoad("30000");
90 $this->click("//tr[@id='field-mystatus']/td[4]/a[1]");
91 $this->waitForPageToLoad("30000");
92 $this->type("name", "Open");
93 $this->clickAndWait("post_changes");
94 $this->type("name", "Resolved");
95 $this->clickAndWait("post_changes");
96 $this->type("name", "Validated");
97 $this->clickAndWait("post_changes");
98 $this->type("name", "Verified");
99 $this->select("status_id", "label=Closed");
100 $this->clickAndWait("post_changes");
101 $this->type("name", "Duplicated");
102 $this->clickAndWait("post_changes");
103 $this->type("name", "Postponed");
104 $this->clickAndWait("post_changes");
105 $this->type("name", "Closed");
106 $this->select("status_id", "label=Closed");
107 $this->click("post_changes");
108 $this->waitForPageToLoad("30000");
109 $this->click("link=Manage Workflow");
110 $this->waitForPageToLoad("30000");
112 $this->click("//tr[@id='configuring-1']//td[3]/input");
113 $this->click("//tr[@id='configuring-1']//td[4]/input");
114 $this->click("//tr[@id='configuring-1']//td[5]/input");
115 $this->click("//tr[@id='configuring-1']//td[6]/input");
116 $this->click("//tr[@id='configuring-1']//td[7]/input");
117 $this->click("//tr[@id='configuring-1']//td[8]/input");
118 $this->click("//tr[@id='configuring-1']//td[9]/input");
119 $this->click("//tr[@id='configuring-1']//td[10]/input");
121 $this->click("//tr[@id='configuring-2']//td[1]/input");
122 $this->click("//tr[@id='configuring-2']//td[4]/input");
123 $this->click("//tr[@id='configuring-2']//td[5]/input");
124 $this->click("//tr[@id='configuring-2']//td[6]/input");
125 $this->click("//tr[@id='configuring-2']//td[7]/input");
126 $this->click("//tr[@id='configuring-2']//td[8]/input");
128 $this->click("//tr[@id='configuring-3']//td[1]/input");
129 $this->click("//tr[@id='configuring-3']//td[2]/input");
130 $this->click("//tr[@id='configuring-3']//td[5]/input");
131 $this->click("//tr[@id='configuring-3']//td[6]/input");
132 $this->click("//tr[@id='configuring-3']//td[7]/input");
133 $this->click("//tr[@id='configuring-3']//td[8]/input");
135 $this->click("//tr[@id='configuring-4']//td[1]/input");
136 $this->click("//tr[@id='configuring-4']//td[3]/input");
137 $this->click("//tr[@id='configuring-4']//td[6]/input");
138 $this->click("//tr[@id='configuring-4']//td[7]/input");
139 $this->click("//tr[@id='configuring-4']//td[8]/input");
140 $this->click("//tr[@id='configuring-4']//td[9]/input");
141 $this->click("//tr[@id='configuring-4']//td[10]/input");
143 $this->click("//tr[@id='configuring-5']//td[1]/input");
144 $this->click("//tr[@id='configuring-5']//td[3]/input");
145 $this->click("//tr[@id='configuring-5']//td[4]/input");
146 $this->click("//tr[@id='configuring-5']//td[7]/input");
147 $this->click("//tr[@id='configuring-5']//td[8]/input");
148 $this->click("//tr[@id='configuring-5']//td[9]/input");
149 $this->click("//tr[@id='configuring-5']//td[10]/input");
151 $this->click("//tr[@id='configuring-6']//td[1]/input");
152 $this->click("//tr[@id='configuring-6']//td[3]/input");
153 $this->click("//tr[@id='configuring-6']//td[4]/input");
154 $this->click("//tr[@id='configuring-6']//td[5]/input");
155 $this->click("//tr[@id='configuring-6']//td[8]/input");
156 $this->click("//tr[@id='configuring-6']//td[9]/input");
157 $this->click("//tr[@id='configuring-6']//td[10]/input");
159 $this->click("//tr[@id='configuring-7']//td[1]/input");
160 $this->click("//tr[@id='configuring-7']//td[2]/input");
161 $this->click("//tr[@id='configuring-7']//td[3]/input");
162 $this->click("//tr[@id='configuring-7']//td[4]/input");
163 $this->click("//tr[@id='configuring-7']//td[5]/input");
164 $this->click("//tr[@id='configuring-7']//td[6]/input");
165 $this->click("//tr[@id='configuring-7']//td[8]/input");
166 $this->click("//tr[@id='configuring-7']//td[9]/input");
167 $this->click("//tr[@id='configuring-7']//td[10]/input");
169 $this->click("//tr[@id='configuring-8']//td[1]/input");
170 $this->click("//tr[@id='configuring-8']//td[2]/input");
171 $this->click("//tr[@id='configuring-8']//td[3]/input");
172 $this->click("//tr[@id='configuring-8']//td[4]/input");
173 $this->click("//tr[@id='configuring-8']//td[5]/input");
174 $this->click("//tr[@id='configuring-8']//td[6]/input");
175 $this->click("//tr[@id='configuring-8']//td[7]/input");
176 $this->click("//tr[@id='configuring-8']//td[9]/input");
177 $this->click("//tr[@id='configuring-8']//td[10]/input");
179 $this->click("//tr[@id='configuring-9']//td[1]/input");
180 $this->click("//tr[@id='configuring-9']//td[3]/input");
181 $this->click("//tr[@id='configuring-9']//td[4]/input");
182 $this->click("//tr[@id='configuring-9']//td[5]/input");
183 $this->click("//tr[@id='configuring-9']//td[6]/input");
184 $this->click("//tr[@id='configuring-9']//td[7]/input");
185 $this->click("//tr[@id='configuring-9']//td[8]/input");
186 $this->click("//tr[@id='configuring-9']//td[10]/input");
188 $this->click("//tr[@id='configuring-10']//td[1]/input");
189 $this->click("//tr[@id='configuring-10']//td[2]/input");
190 $this->click("//tr[@id='configuring-10']//td[3]/input");
191 $this->click("//tr[@id='configuring-10']//td[4]/input");
192 $this->click("//tr[@id='configuring-10']//td[5]/input");
193 $this->click("//tr[@id='configuring-10']//td[6]/input");
194 $this->click("//tr[@id='configuring-10']//td[7]/input");
195 $this->click("//tr[@id='configuring-10']//td[8]/input");
196 $this->click("//tr[@id='configuring-10']//td[9]/input");
198 $this->click("post_changes");
199 $this->waitForPageToLoad("30000");
200 $this->assertTrue($this->isTextPresent("Workflow saved"));
202 // Ensure that it is not possible to configure the workflow without initial state.
203 $this->click("//tr[@id='initval']//td[1]/input");
204 $this->click("//tr[@id='initval']//td[2]/input");
205 $this->click("//tr[@id='initval']//td[3]/input");
206 $this->click("//tr[@id='initval']//td[4]/input");
207 $this->click("//tr[@id='initval']//td[5]/input");
208 $this->click("//tr[@id='initval']//td[6]/input");
209 $this->click("//tr[@id='initval']//td[7]/input");
210 $this->click("//tr[@id='initval']//td[8]/input");
211 $this->click("//tr[@id='initval']//td[9]/input");
212 $this->click("//tr[@id='initval']//td[10]/input");
213 $this->click("post_changes");
214 $this->waitForPageToLoad("30000");
215 $this->assertTrue($this->isTextPresent("ERROR: Initial values not saved"));
216 $this->assertTrue($this->isTextPresent("Workflow saved"));
218 $this->click("//tr[@id='initval']//td[9]/input");
219 $this->click("post_changes");
220 $this->waitForPageToLoad("30000");
221 $this->assertTrue($this->isTextPresent("Workflow saved"));
227 // c-file-style: "bsd"