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 CreateTrackerWorkflow extends FForge_SeleniumTestCase
50 function testWorkflow()
52 $this->createProject('ProjectA');
54 // Testing extra-fields
56 $this->click("link=ProjectA");
57 $this->waitForPageToLoad("30000");
58 $this->click("link=Tracker");
59 $this->waitForPageToLoad("30000");
60 $this->click("link=Bugs");
61 $this->waitForPageToLoad("30000");
62 $this->click("//a[contains(@href, '".BASE. "/tracker/admin/?group_id=6&atid=101')]");
63 $this->waitForPageToLoad("30000");
64 $this->click("link=Manage Custom Fields");
65 $this->waitForPageToLoad("30000");
66 $this->type("name", "MyStatus");
67 $this->type("alias", "mystatus");
68 $this->click("document.forms[2].field_type[6]");
69 $this->click("post_changes");
70 $this->waitForPageToLoad("30000");
71 $this->click("//tr[@id='field-mystatus']/td[3]/a[1]");
72 $this->waitForPageToLoad("30000");
73 $this->type("name", "New");
74 $this->click("post_changes");
75 $this->waitForPageToLoad("30000");
76 $this->click("link=Manage Custom Fields");
77 $this->waitForPageToLoad("30000");
78 $this->click("//tr[@id='field-mystatus']/td[3]/a[3]");
79 $this->waitForPageToLoad("30000");
80 $this->type("name", "Analyse");
81 $this->select("status_id", "label=Open");
82 $this->click("post_changes");
83 $this->waitForPageToLoad("30000");
84 $this->click("link=Manage Workflow");
85 $this->waitForPageToLoad("30000");
86 $this->click("link=Manage Custom Fields");
87 $this->waitForPageToLoad("30000");
88 $this->click("//a[contains(@href, '/tracker/admin/index.php?add_opt=1&boxid=22&group_id=6&atid=101')]");
89 $this->waitForPageToLoad("30000");
90 $this->type("name", "Candidate");
91 $this->click("post_changes");
92 $this->waitForPageToLoad("30000");
93 $this->click("link=Manage Custom Fields");
94 $this->waitForPageToLoad("30000");
95 $this->click("//a[contains(@href, '/tracker/admin/index.php?add_opt=1&boxid=22&group_id=6&atid=101')]");
96 $this->waitForPageToLoad("30000");
97 $this->type("name", "Open");
98 $this->click("post_changes");
99 $this->waitForPageToLoad("30000");
100 $this->type("name", "Resolved");
101 $this->click("post_changes");
102 $this->waitForPageToLoad("30000");
103 $this->type("name", "Validated");
104 $this->click("post_changes");
105 $this->waitForPageToLoad("30000");
106 $this->type("name", "Verified");
107 $this->select("status_id", "label=Closed");
108 $this->click("post_changes");
109 $this->waitForPageToLoad("30000");
110 $this->type("name", "Duplicated");
111 $this->click("post_changes");
112 $this->waitForPageToLoad("30000");
113 $this->type("name", "Postponed");
114 $this->click("post_changes");
115 $this->waitForPageToLoad("30000");
116 $this->type("name", "Closed");
117 $this->select("status_id", "label=Closed");
118 $this->click("post_changes");
119 $this->waitForPageToLoad("30000");
120 $this->click("link=Manage Workflow");
121 $this->waitForPageToLoad("30000");
122 $this->click("wk[157][159]");
123 $this->click("wk[157][160]");
124 $this->click("wk[157][161]");
125 $this->click("wk[157][162]");
126 $this->click("wk[157][163]");
127 $this->click("wk[157][164]");
128 $this->click("wk[157][165]");
129 $this->click("wk[157][166]");
130 $this->click("wk[158][157]");
131 $this->click("wk[159][160]");
132 $this->click("wk[159][161]");
133 $this->click("wk[159][162]");
134 $this->click("wk[159][163]");
135 $this->click("wk[159][157]");
136 $this->click("wk[159][158]");
137 $this->click("wk[159][158]");
138 $this->click("wk[159][157]");
139 $this->click("wk[158][160]");
140 $this->click("wk[158][161]");
141 $this->click("wk[158][162]");
142 $this->click("wk[158][163]");
143 $this->click("wk[158][164]");
144 $this->click("wk[158][165]");
145 $this->click("wk[158][166]");
146 $this->click("wk[158][166]");
147 $this->click("wk[158][165]");
148 $this->click("wk[159][157]");
149 $this->click("wk[159][158]");
150 $this->click("wk[159][164]");
151 $this->click("wk[159][165]");
152 $this->click("wk[159][166]");
153 $this->click("wk[159][160]");
154 $this->click("wk[159][166]");
155 $this->click("wk[159][165]");
156 $this->click("wk[160][157]");
157 $this->click("wk[160][158]");
158 $this->click("wk[160][159]");
159 $this->click("wk[160][161]");
160 $this->click("wk[160][162]");
161 $this->click("wk[160][163]");
162 $this->click("wk[160][164]");
163 $this->click("wk[160][165]");
164 $this->click("wk[160][166]");
165 $this->click("wk[160][158]");
166 $this->click("wk[160][161]");
167 $this->click("wk[161][157]");
168 $this->click("wk[161][158]");
169 $this->click("wk[161][159]");
170 $this->click("wk[161][160]");
171 $this->click("wk[161][162]");
172 $this->click("wk[161][163]");
173 $this->click("wk[161][164]");
174 $this->click("wk[161][165]");
175 $this->click("wk[161][166]");
176 $this->click("wk[161][162]");
177 $this->click("wk[161][158]");
178 $this->click("wk[162][157]");
179 $this->click("wk[162][158]");
180 $this->click("wk[162][159]");
181 $this->click("wk[162][160]");
182 $this->click("wk[162][161]");
183 $this->click("wk[162][164]");
184 $this->click("wk[162][163]");
185 $this->click("wk[162][165]");
186 $this->click("wk[162][166]");
187 $this->click("wk[162][158]");
188 $this->click("wk[162][158]");
189 $this->click("wk[162][158]");
190 $this->click("wk[162][163]");
191 $this->click("wk[163][157]");
192 $this->click("wk[163][158]");
193 $this->click("wk[163][159]");
194 $this->click("wk[163][160]");
195 $this->click("wk[163][161]");
196 $this->click("wk[163][162]");
197 $this->click("wk[163][164]");
198 $this->click("wk[163][165]");
199 $this->click("wk[163][166]");
200 $this->click("wk[164][157]");
201 $this->click("wk[164][158]");
202 $this->click("wk[164][159]");
203 $this->click("wk[164][160]");
204 $this->click("wk[164][161]");
205 $this->click("wk[164][162]");
206 $this->click("wk[164][163]");
207 $this->click("wk[164][165]");
208 $this->click("wk[164][166]");
209 $this->click("wk[165][157]");
210 $this->click("wk[165][158]");
211 $this->click("wk[165][159]");
212 $this->click("wk[165][160]");
213 $this->click("wk[165][161]");
214 $this->click("wk[165][162]");
215 $this->click("wk[165][163]");
216 $this->click("wk[165][164]");
217 $this->click("wk[165][166]");
218 $this->click("wk[165][158]");
219 $this->click("wk[166][157]");
220 $this->click("wk[166][158]");
221 $this->click("wk[166][159]");
222 $this->click("wk[166][160]");
223 $this->click("wk[166][161]");
224 $this->click("wk[166][162]");
225 $this->click("wk[166][163]");
226 $this->click("wk[166][164]");
227 $this->click("wk[166][165]");
228 $this->click("post_changes");
229 $this->waitForPageToLoad("30000");
230 $this->assertTrue($this->isTextPresent("Workflow saved"));
232 // Ensure that it is not possible to configure the workflow without initial state.
233 $this->click("wk[100][157]");
234 $this->click("wk[100][158]");
235 $this->click("wk[100][159]");
236 $this->click("wk[100][160]");
237 $this->click("wk[100][161]");
238 $this->click("wk[100][162]");
239 $this->click("wk[100][163]");
240 $this->click("wk[100][164]");
241 $this->click("wk[100][165]");
242 $this->click("wk[100][166]");
243 $this->click("post_changes");
244 $this->waitForPageToLoad("30000");
245 $this->assertTrue($this->isTextPresent("ERROR: Initial values not saved"));
246 $this->assertTrue($this->isTextPresent("Workflow saved"));