test-suite/tests/013_comt-admin-user-list.js
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 16:49:53 +0200
changeset 650 2a07f8bda874
parent 649 fcf5309284df
permissions -rw-r--r--
increase timeout for dev env which is a little bit slower when creating user in bulk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
646
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     1
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     2
suite ('comt logged admin user list', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     3
650
2a07f8bda874 increase timeout for dev env which is a little bit slower when creating user in bulk
Yves-Marie Haussonne <ymh.work+github@gmail.com>
parents: 649
diff changeset
     4
	this.timeout(100000);
646
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     5
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     6
	suite ('people list page conformity', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     7
		test_page_loading	('/user/', 'People\' list\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     8
		test_comt_logged_header (C.W.USER_ADMIN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     9
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    10
		test_count	('#user ul.sub_list:eq(0) a', 2);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    11
		test_text	('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    12
		test_text	('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    13
		test_text	('#filter_form a[href="?display=1"]', 'Display suspended users');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    14
		test_count	('form#filter_form[action="."] :input', 1);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    15
		test_text	('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    16
		test_text	('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    17
		test_text	('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    18
		test_text	('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    19
		test_text	('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    20
		test_text	('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    21
		test_text	('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    22
		test_text	('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    23
		test_text	('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', C.HIDDEN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    24
		test_val	('form#user_form input#apply[type=button][disabled]', 'Apply');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    25
		test_match	('#paginator', /\s1-4 of 4\s/m);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    26
		test_count	('table.large_table:eq(1) th', 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    27
		test_val	('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    28
		test_text	('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    29
		test_text	('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    30
		test_text	('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    31
		test_text	('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    32
		test_text	('table.large_table:eq(1) th:eq(5)', 'Last week activity');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    33
		test_text	('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    34
		test_text	('table.large_table:eq(1) a.main_object_title[href="/profile/"]', C.W.USER_ADMIN);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    35
		test_text	('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    36
		test_val	('form#user_form input#save[type="submit"][disabled]', 'Save');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    37
		test_exist	('#user_form tr:eq(1) td:eq(4) select[disabled]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    38
		test_exist	('#user_form tr:eq(1) td:eq(0) input[type=checkbox][disabled]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    39
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    40
		for (var i=1; i < 5; i++) {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    41
			test_text	('#user_form tr:eq('+i+') td:eq(1) a.main_object_title', C.USERS[i].name);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    42
			test_text	('#user_form tr:eq('+i+') td:eq(2) a[href="mailto:'+C.USERS[i].email+'"]', C.USERS[i].email);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    43
			test_text	('#user_form tr:eq('+i+') td:eq(3)', C.USERS[i].date);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    44
			test_count	('#user_form tr:eq('+i+') td:eq(4) select option', 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    45
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(0)[value=""]', '---------', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    46
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(1)[value="1"]', 'Manager', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    47
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(2)[value="2"]', 'Editor', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    48
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(3)[value="3"]', 'Moderator', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    49
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(4)[value="4"]', 'Commentator', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    50
			test_text	('#user_form tr:eq('+i+') td:eq(4) select option:eq(5)[value="5"]', 'Observer', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    51
			test_val	('#user_form tr:eq('+i+') td:eq(4) select', C.USERS[i].role);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    52
		}
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    53
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    54
		test_text	('#user_form tr:eq(6) td:eq(1) a.main_object_title[href="/user/-/edit/"]', 'Anonymous users');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    55
		test_text	('#user_form tr:eq(6) td:eq(2)', '-');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    56
		test_text	('#user_form tr:eq(6) td:eq(3)', '-');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    57
		test_exist	('#user_form tr:eq(6) td:eq(4) select');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    58
		test_count	('#user_form tr:eq(6) td:eq(4) select option', 3);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    59
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(0)[value=""][selected]', '---------', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    60
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(1)[value="4"]', 'Commentator', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    61
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(2)[value="5"]', 'Observer', C.H);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    62
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(0)[href^="/user/"][href$="/edit/"]', 'Edit');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    63
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(1)[href^="/use"][href$="ontact/"]','Contact');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    64
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(2)[id^="user-suspend-"]', 'Suspend access');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    65
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(3)[id^="user-resen"]','(Re-)send invitation');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    66
		test_comt_unlogged_footer ();
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    67
	});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    68
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    69
	suite_check_user_nb (1);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    70
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    71
	suite ('Reset fixture user roles', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    72
		test		('set user-com Commentator', dsl(function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    73
			input ('#user_form tr:eq(2) td:eq(4) select').option ('4');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    74
			input ('#user_form tr:eq(3) td:eq(4) select').option ('2');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    75
			input ('#user_form tr:eq(4) td:eq(4) select').option ('5');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    76
			input ('#save').prop ('disabled', false);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    77
		}));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    78
		test_click	('#save', C.WAIT_PAGE_LOAD);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    79
		test_page_loading ('/user/', 'People\' list\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    80
		test_val	('#user_form tr:eq(2) td:eq(4) select option:selected', '4');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    81
		test_val	('#user_form tr:eq(3) td:eq(4) select option:selected', '2');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    82
		test_val	('#user_form tr:eq(4) td:eq(4) select option:selected', '5');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    83
	});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    84
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    85
	suite ('Add a single user', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    86
		test_comt_create_user (C.USERS[5]);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    87
	});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    88
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    89
	suite_check_user_nb (2);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    90
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    91
	suite ('Add users in bulk', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    92
		test_page_loading ('/user/mass-add/', 'Add users in bulk\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    93
	    test ('fill emails', dsl(function (){
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    94
	        elt ('#id_email').val ('uc2@t.co,uc3@t.co,uc4@t.co,uc5@t.co,uc6@t.co,uc7@t.co');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    95
	    }));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    96
		test_fill_field	('#id_tags', {'#id_tags': 'tag_ucs, other_tag' });
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    97
		// TOTEST fill note field
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    98
		test_click  ('#user input[type="submit"]', C.WAIT_PAGE_LOAD);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    99
		test_comt.user_nb += 6;
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   100
	});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   101
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   102
	suite_check_user_nb (3);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   103
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   104
    suite ('users list pagination conformity', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   105
		test_page_loading	('/user/', 'People\' list\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   106
        test_count  ('#user_form :input', 6 + (test_comt.user_nb < 10 ? test_comt.user_nb : 10) * 2);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   107
        test_match  ('#paginator', new RegExp ('\\s1-10 of '+test_comt.user_nb+'\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   108
        test_text   ('#paginator a:eq(0)[href="?page=2"]', '»');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   109
        test_text   ('#paginator a:eq(1)[href="?paginate=0"]', 'all');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   110
        test_click  ('#paginator a:eq(0)[href="?page=2"]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   111
        test_match  ('#paginator', new RegExp ('\\s11-11 of '+test_comt.user_nb+'\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   112
        test_count  ('#user_form :input', test_comt.user_nb % 10 * 2 + 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   113
        test_click  ('#paginator a:eq(0)[href="?page=1"]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   114
        test_match  ('#paginator', new RegExp ('\\s1-10 of '+test_comt.user_nb+'\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   115
        test_count  ('#user_form :input', (test_comt.user_nb < 10 ? test_comt.user_nb : 10) * 2 + 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   116
        test_click  ('#paginator a:eq(1)[href="?paginate=0&page=1"]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   117
        test_match  ('#paginator', /\s\(paginate\)\s/m);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   118
        test_count  ('#user_form :input', test_comt.user_nb * 2 + 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   119
        test_click  ('#paginator a:eq(0)[href="?paginate=&page=1"]');
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   120
        test_count  ('#user_form :input', (test_comt.user_nb < 10 ? test_comt.user_nb : 10) * 2 + 6);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   121
        test_match  ('#paginator', new RegExp ('\\s1-10 of '+test_comt.user_nb+'\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   122
    });
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   123
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   124
    suite ('users list filter by tag conformity', function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   125
		test_page_loading ('/user/?tag_selected=tag_ucs', 'People\' list\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   126
		test_count	('#user_form :input', 6 + 6 * 2);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   127
		test_match	('#paginator', new RegExp ('\\s1-6 of 6\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   128
		
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   129
    });
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   130
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   131
	// TOTEST : filter by tag -> commentator user should be tagged commentator (to change in fixture)
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   132
	// TOTEST : Bulk Actions -> Apply does enable
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   133
	// suspend users
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   134
	// TOTEST display suspended users
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   135
	// TOTEST user édition
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   136
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   137
	// TOTEST suspended user can't login anymore
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   138
	// TOTEST roles of users
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   139
	// TOTEST si les users anonymes ont droits, ils ont droits…
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   140
});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   141
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   142
function suite_check_user_nb (n) {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   143
	suite ('check user number #'+n, function () {
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   144
		test_page_loading	('/user/?display=1', 'People\' list\n - '+C['#id_workspace_name']);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   145
		test_count	('#user_form :input', 6 + (test_comt.user_nb < 10 ? test_comt.user_nb : 10) * 2);
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   146
		test_match	('#paginator', new RegExp ('\\s\\d+-\\d+ of '+test_comt.user_nb+'\\s','m'));
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   147
	});
24067001082c Test user list, creation, filter, and in a separate file
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   148
}