154 test_comt_logged_header (C.W.USER_ADMIN); |
154 test_comt_logged_header (C.W.USER_ADMIN); |
155 test_comt_default_tabs (test_comt.text_nb, test_comt.user_nb); |
155 test_comt_default_tabs (test_comt.text_nb, test_comt.user_nb); |
156 test_count ('#user ul.sub_list:eq(0) a', 2); |
156 test_count ('#user ul.sub_list:eq(0) a', 2); |
157 test_text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user'); |
157 test_text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user'); |
158 test_text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
158 test_text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
159 // TOTEST : filter by tag -> commentator user should be tagged commentator (to change in fixture) |
159 test_text ('#filter_form a[href="?display=1"]', 'Display suspended users'); |
160 test_count ('form#filter_form[action="."] :input', 1); |
160 test_count ('form#filter_form[action="."] :input', 1); |
161 test_text ('#filter_form a[href="?display=1"]', 'Display suspended users'); |
|
162 test_text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', C.HIDDEN); |
161 test_text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', C.HIDDEN); |
163 // TOTEST : pagination |
|
164 // TOTEST : Bulk Actions -> Apply does enable |
|
165 // TOTEST display suspended users |
|
166 test_text ('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', C.HIDDEN); |
162 test_text ('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', C.HIDDEN); |
167 test_text ('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', C.HIDDEN); |
163 test_text ('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', C.HIDDEN); |
168 test_text ('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', C.HIDDEN); |
164 test_text ('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', C.HIDDEN); |
169 test_text ('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', C.HIDDEN); |
165 test_text ('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', C.HIDDEN); |
170 test_text ('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', C.HIDDEN); |
166 test_text ('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', C.HIDDEN); |
171 test_text ('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', C.HIDDEN); |
167 test_text ('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', C.HIDDEN); |
172 test_text ('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', C.HIDDEN); |
168 test_text ('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', C.HIDDEN); |
173 test_text ('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', C.HIDDEN); |
169 test_text ('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', C.HIDDEN); |
174 test_val ('form#user_form input#apply[type=button][disabled]', 'Apply'); |
170 test_val ('form#user_form input#apply[type=button][disabled]', 'Apply'); |
|
171 test_match ('#paginator', /\s1-4 of 4\s/m); |
175 test_count ('table.large_table:eq(1) th', 6); |
172 test_count ('table.large_table:eq(1) th', 6); |
176 test_val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
173 test_val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
177 test_text ('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User'); |
174 test_text ('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User'); |
178 test_text ('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email'); |
175 test_text ('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email'); |
179 test_text ('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined'); |
176 test_text ('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined'); |
180 test_text ('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role'); |
177 test_text ('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role'); |
181 test_text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
178 test_text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
182 test_text ('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users'); |
179 test_text ('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users'); |
183 test_text ('table.large_table:eq(1) a.main_object_title[href="/profile/"]', C.W.USER_ADMIN); |
180 test_text ('table.large_table:eq(1) a.main_object_title[href="/profile/"]', C.W.USER_ADMIN); |
184 test_text ('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile'); |
181 test_text ('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile'); |
185 // TOTEST roles of users |
182 test_val ('form#user_form input#save[type="submit"][disabled]', 'Save'); |
|
183 test_exist ('#user_form tr:eq(1) td:eq(4) select[disabled]'); |
|
184 test_count ('#user_form tr:eq(1) td:eq(4) select[disabled] option', 6); |
|
185 test_text ('#user_form tr:eq(1) td:eq(4) select option:eq(0)[value=""][selected]', '---------', C.H); |
|
186 test_text ('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(1)[value="1"]', 'Manager', C.H); |
|
187 test_text ('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(2)[value="2"]', 'Editor', C.H); |
|
188 test_text ('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(3)[value="3"]', 'Moderator', C.H); |
|
189 test_text ('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(4)[value="4"]', 'Commentator', C.H); |
|
190 test_text ('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(5)[value="5"]', 'Observer', C.H); |
|
191 test_val ('#user_form tr:eq(2) td:eq(4) select', '5'); // this is a bug should be 4 |
|
192 test_val ('#user_form tr:eq(3) td:eq(4) select', '5'); // this is a bug should be 2 |
|
193 test_val ('#user_form tr:eq(4) td:eq(4) select', '5'); |
|
194 test_exist ('#user_form tr:eq(6) td:eq(4) select'); |
|
195 test_count ('#user_form tr:eq(6) td:eq(4) select option', 3); |
|
196 test_text ('#user_form tr:eq(6) td:eq(4) select option:eq(0)[value=""][selected]', '---------', C.H); |
|
197 test_text ('#user_form tr:eq(6) td:eq(4) select option:eq(1)[value="4"]', 'Commentator', C.H); |
|
198 test_text ('#user_form tr:eq(6) td:eq(4) select option:eq(2)[value="5"]', 'Observer', C.H); |
|
199 test_exist ('#user_form tr:eq(1) td:eq(0) input[type=checkbox][disabled]'); |
|
200 test_text ('#user_form div.hidden-user-actions:eq(1) a:eq(0)[href^="/user/"][href$="/edit/"]', 'Edit'); |
|
201 test_text ('#user_form div.hidden-user-actions:eq(1) a:eq(1)[href^="/use"][href$="ontact/"]', 'Contact'); |
|
202 test_text ('#user_form div.hidden-user-actions:eq(1) a:eq(2)[id^="user-suspend-"]', 'Suspend access'); |
|
203 test_text ('#user_form div.hidden-user-actions:eq(1) a:eq(3)[id^="user-resen"]', '(Re-)send invitation'); |
186 test_comt_unlogged_footer (); |
204 test_comt_unlogged_footer (); |
187 }); |
205 }); |
188 |
206 |
189 suite ('check user number', function () { |
207 suite ('check user number', function () { |
190 test_page_loading ('/user/?display=1', 'People\' list\n - '+C['#id_workspace_name']); |
208 test_page_loading ('/user/?display=1', 'People\' list\n - '+C['#id_workspace_name']); |
191 test_count ('#user_form :input', 6 + (test_comt.user_nb % 10) * 2); |
209 test_count ('#user_form :input', 6 + (test_comt.user_nb % 10) * 2); |
192 test_match ('#paginator', new RegExp ('\\s\\d+-\\d+ of '+test_comt.user_nb+'\\s','m')); |
210 test_match ('#paginator', new RegExp ('\\s\\d+-\\d+ of '+test_comt.user_nb+'\\s','m')); |
|
211 }); |
|
212 |
|
213 suite ('Reset fixture user roles', function () { |
|
214 test ('set user-com Commentator', dsl(function () { |
|
215 input ('#user_form tr:eq(2) td:eq(4) select').option ('4'); |
|
216 input ('#user_form tr:eq(3) td:eq(4) select').option ('2'); |
|
217 input ('#user_form tr:eq(4) td:eq(4) select').option ('5'); |
|
218 input ('#save').prop ('disabled', false); |
|
219 })); |
|
220 test_click ('#save', C.WAIT_PAGE_LOAD); |
|
221 test_page_loading ('/user/', 'People\' list\n - '+C['#id_workspace_name']); |
|
222 test_val ('#user_form tr:eq(2) td:eq(4) select option:selected', '4'); |
|
223 test_val ('#user_form tr:eq(3) td:eq(4) select option:selected', '2'); |
|
224 test_val ('#user_form tr:eq(4) td:eq(4) select option:selected', '5'); |
|
225 |
|
226 |
|
227 // TOTEST roles of users |
|
228 // TOTEST : filter by tag -> commentator user should be tagged commentator (to change in fixture) |
|
229 // TOTEST : pagination |
|
230 // TOTEST : Bulk Actions -> Apply does enable |
|
231 // TOTEST display suspended users |
193 }); |
232 }); |
194 |
233 |
195 suite ('add a user page conformity', function () { |
234 suite ('add a user page conformity', function () { |
196 test_page_loading ('/user/add/', 'Add a new user\n - '+C['#id_workspace_name']); |
235 test_page_loading ('/user/add/', 'Add a new user\n - '+C['#id_workspace_name']); |
197 test_comt_logged_header (C.W.USER_ADMIN); |
236 test_comt_logged_header (C.W.USER_ADMIN); |