test-suite/tests/011_comt-logged-admin.js
author Simon Descarpentries <sid@sopinspace.com>
Wed, 23 Apr 2014 19:39:58 +0200
changeset 641 8f7dafe42d15
parent 638 61dc5370b351
child 646 24067001082c
permissions -rw-r--r--
Refine user list tests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     1
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     2
// " Vim settings
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     3
// set tabstop=4		  " number of spaces in a tab
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     4
// set softtabstop=4	  " as above
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     5
// set shiftwidth=4		  " as above
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     6
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     7
suite ('comt logged admin', function () {
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     8
637
71d87ca43d6a Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents: 636
diff changeset
     9
	this.timeout(20000);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    10
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    11
	suite ('logs as an admin', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    12
		test_comt_login (C.W.USER_ADMIN, C.W.PASS_ADMIN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    13
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    14
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    15
	suite ('setting settings to test-values', function () {
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    16
		test_page_loading ('/settings/', 'Settings');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    17
		test_comt_fill_settings (C);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    18
		test_val	('#id_workspace_name', C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    19
		test_click	('#settings input[type="submit"]', C.WAIT_PAGE_LOAD);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    20
		test_page_loading	('/settings/', 'Settings');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    21
		test_text	('#content h1.main_title a[href="/"]', C['#id_workspace_name']);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    22
		test_page_loading	('/settings/design/', 'Settings');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    23
		test_comt_fill_design (C);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    24
		test_click	('#settings input[type="submit"]', C.WAIT_PAGE_LOAD);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    25
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    26
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    27
	suite ('admin dashboard page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    28
		test_page_loading ('/', 'Dashboard\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    29
		test_comt_logged_header (C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    30
		test_comt_default_tabs (test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    31
		test_count	('table.dash_table', 5);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    32
		test_text	('table.dash_table th:eq(0)', 'Actions');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    33
		test_match	('table.dash_table:eq(0) a:eq(0)[href="/create/content/"]', /\sCreate a text/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    34
		test_text	('table.dash_table:eq(0) a:eq(1).tip[href="#"]', '\xa0');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    35
		test_match	('table.dash_table:eq(0) a:eq(2)[href="/create/upload/"]', /\sUpload a text/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    36
		test_text	('table.dash_table:eq(0) a:eq(3).tip[href="#"]', '\xa0');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    37
		test_match	('table.dash_table:eq(0) a:eq(4)[href="/create/import/"]', /\sImport a co-mented text/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    38
		test_text	('table.dash_table:eq(0) a:eq(5).tip[href="#"]', '\xa0');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    39
		test_match	('table.dash_table:eq(0) a:eq(6)[href="/user/add/"]', /\sInvite user/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    40
		test_match	('table.dash_table:eq(0) a:eq(7)[href="/profile/"]', /\sEdit your profile/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    41
		test_match	('table.dash_table:eq(0) a:eq(8)[href="/text/"]', /\sView text list/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    42
		test_match	('table.dash_table:eq(0) a:eq(9)[href="/settings/"]', /\sConfigure workspace/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    43
		test_text	('table.dash_table th:eq(1)', 'Recent texts (all)');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    44
		test_text	('table.dash_table:eq(1) a:eq(0)[href="/text/"]', 'all');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    45
		test_text	('table.dash_table th:eq(2)', 'Recent comments');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    46
		test_match	('table.dash_table th:eq(3)', /^Workspace activity\n\s+\(month\/week\/24 hours\)$/m);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    47
		test_text	('table.dash_table:eq(3) a:eq(0)[href="?span=month"]', 'month');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    48
		test_text	('table.dash_table:eq(3) a:eq(1)[href="?span=day"]', '24 hours');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    49
		test_text	('table.dash_table th:eq(4) span.em', 'Activities');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    50
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    51
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    52
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    53
	suite ('create a text page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    54
		test_page_loading	('/create/content/', 'Create a text - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    55
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    56
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    57
		test_count	('#text ul.sub_list:eq(0) a', 3);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    58
		test_text	('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    59
		test_text	('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    60
		test_text	('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    61
		test_count	('#text form[action="."]:eq(0) :input', 6);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    62
		test_field	('text', 'id_title',	'text', 0, 'Title', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    63
		test_field	('text', 'id_format',	'select', 1, 'Format', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    64
		test_field	('text', 'id_content',	'textarea', 2, 'Content', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    65
		test_field	('text', 'id_tags',		'text', 3, 'Tags');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    66
		test_val	('#text :input:eq(4)[type=submit]', 'Save');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    67
		test_val	('#text :input:eq(5)#cancel_button[type=button]', 'Cancel');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    68
		test_count	('select#id_format option', 3);
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    69
		test_text	('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    70
		test_text	('select#id_format option:eq(1)[value="rst"]', 'rst', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    71
		test_text	('select#id_format option:eq(2)[value="html"]', 'html', C.HIDDEN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    72
		test_count	('.markdown #markItUpId_content li', 20); // How many buttons in the WYSIWYG editor toolbar ?
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    73
		test_comt_unlogged_footer ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    74
		test_click	('#text input[type="submit"]', C.WAIT_PAGE_LOAD);
636
a8ab808d33c3 Test bulk text deletion with new karma-e2e-dsl tweaked version
Simon Descarpentries <sid@sopinspace.com>
parents: 635
diff changeset
    75
		test_count	('div.help_text span.error-text', 2);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    76
		test_field	('text div.error', 'id_title',		'text', 0, 'Title', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    77
		test_field	('text div.error', 'id_content',	'textarea', 1, 'Content', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    78
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    79
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    80
	suite ('upload text page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    81
		test_page_loading	('/create/upload/', 'Upload a text - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    82
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    83
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    84
		test_count	('#text ul.sub_list:eq(0) a', 3);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    85
		test_text	('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    86
		test_text	('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    87
		test_text	('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    88
		test_count	('#text form[action="."]:eq(0) :input', 6);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    89
		test_field	('text', 'id_title',	'text', 0, 'Title');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    90
		test_field	('text', 'id_format',	'select', 1, 'Format', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    91
		test_field	('text', 'id_tags',		'text', 2, 'Tags');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
    92
		test_field	('text', 'id_file',		'file', 3, 'Upload file');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    93
		test_val	('#text :input:eq(4)[type=submit]', 'Save');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    94
		test_val	('#text :input:eq(5)#cancel_button[type=button]', 'Cancel');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    95
		test_count	('select#id_format option', 3);
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    96
		test_text	('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    97
		test_text	('select#id_format option:eq(1)[value="rst"]', 'rst', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    98
		test_text	('select#id_format option:eq(2)[value="html"]', 'html', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    99
		test_comt_unlogged_footer ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   100
		test_click	('#text input[type="submit"]', C.WAIT_PAGE_LOAD);
636
a8ab808d33c3 Test bulk text deletion with new karma-e2e-dsl tweaked version
Simon Descarpentries <sid@sopinspace.com>
parents: 635
diff changeset
   101
		test_count	('div.help_text span.error-text', 1);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   102
		test_field	('text div.error', 'id_file',		'file', 0, 'Upload file');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   103
		test_match	('#text div.help_text:eq(3) span.error-text:eq(0)', /You should specify a file to upload/m);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   104
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   105
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   106
	suite ('import a co-mented text page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   107
		test_page_loading	('/create/import/', 'Import a co-mented text - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   108
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   109
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   110
		test_count	('#text ul.sub_list:eq(0) a', 3);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   111
		test_text	('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   112
		test_text	('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   113
		test_text	('#text ul.sub_list:eq(0) a:eq(2)[href="/create/upload/"]', 'Upload a text');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   114
		test_count	('#text form[action="."]:eq(0) :input', 3);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   115
		test_field	('text', 'id_file',	'file', 0, 'Upload XML file', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   116
		test_val	('#text :input:eq(1)[type=submit]', 'Save');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   117
		test_val	('#text :input:eq(2)#cancel_button[type=button]', 'Cancel');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   118
		test_comt_unlogged_footer ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   119
		test_click	('#text input[type="submit"]', C.WAIT_PAGE_LOAD);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   120
		test_count	('div.help_text span.error-text', 1);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   121
		test_field	('text div.error', 'id_file',		'file', 0, 'Upload XML file', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   122
		test_match	('#text div.help_text:eq(0) span.error-text:eq(0)', /You should specify a file to upload/m);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   123
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   124
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   125
	suite ('edit profile page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   126
		test_page_loading	('/profile/', 'Your profile \\('+C.W.USER_ADMIN+'\\)\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   127
		test_comt_logged_header	(C.W.USER_ADMIN, C.NO_TAGLINE);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   128
		test_count	('#content ul.sub_list:eq(0) a', 1);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   129
		test_text	('#content ul.sub_list:eq(0) a:eq(0)[href="/profile-pw/"]', 'Password');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   130
		test_count	('form#profile[action="."]:eq(0) :input', 5);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   131
		test_field	('profile', 'id_email',		'text', 0, 'E-mail address', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   132
		test_field	('profile', 'id_first_name','text', 1, 'First name');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   133
		test_field	('profile', 'id_last_name',	'text', 2, 'Last name');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   134
		test_field	('profile', 'id_tags',		'text', 3, 'Tags');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   135
		test_val	('#profile :input:eq(4)[type=submit]', 'Save');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   136
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   137
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   138
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   139
	suite ('edit password page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   140
		test_page_loading	('/profile-pw/', 'Your profile [(]'+C.W.USER_ADMIN+'[)]\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   141
		test_comt_logged_header	(C.W.USER_ADMIN, C.NO_TAGLINE);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   142
		test_count	('#content ul.sub_list:eq(0) a', 1);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   143
		test_text	('#content ul.sub_list:eq(0) a:eq(0)[href="/profile/"]', 'Profile');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   144
		test_count	('form#profile[action="."]:eq(0) :input', 4);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   145
		test_field	('profile', 'id_old_password',	'password', 0, 'Old password', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   146
		test_field	('profile', 'id_new_password1', 'password', 1, 'New password', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   147
		test_field	('profile', 'id_new_password2',	'password', 2, 'New password confirmation', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   148
		test_val	('#profile :input:eq(3)[type=submit]', 'Save');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   149
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   150
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   151
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   152
	suite ('people list page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   153
		test_page_loading	('/user/', 'People\' list\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   154
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   155
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   156
		test_count	('#user ul.sub_list:eq(0) a', 2);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   157
		test_text	('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   158
		test_text	('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk');
641
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   159
		test_text	('#filter_form a[href="?display=1"]', 'Display suspended users');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   160
		test_count	('form#filter_form[action="."] :input', 1);
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   161
		test_text	('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   162
		test_text	('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   163
		test_text	('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   164
		test_text	('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   165
		test_text	('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   166
		test_text	('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   167
		test_text	('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   168
		test_text	('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   169
		test_text	('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', C.HIDDEN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   170
		test_val	('form#user_form input#apply[type=button][disabled]', 'Apply');
641
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   171
		test_match  ('#paginator', /\s1-4 of 4\s/m);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   172
		test_count	('table.large_table:eq(1) th', 6);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   173
		test_val	('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   174
		test_text	('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   175
		test_text	('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   176
		test_text	('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   177
		test_text	('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   178
		test_text	('table.large_table:eq(1) th:eq(5)', 'Last week activity');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   179
		test_text	('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   180
		test_text	('table.large_table:eq(1) a.main_object_title[href="/profile/"]', C.W.USER_ADMIN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   181
		test_text	('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile');
641
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   182
		test_val	('form#user_form input#save[type="submit"][disabled]', 'Save');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   183
		test_exist	('#user_form tr:eq(1) td:eq(4) select[disabled]');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   184
		test_count	('#user_form tr:eq(1) td:eq(4) select[disabled] option', 6);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   185
		test_text	('#user_form tr:eq(1) td:eq(4) select option:eq(0)[value=""][selected]', '---------', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   186
		test_text	('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(1)[value="1"]', 'Manager', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   187
		test_text	('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(2)[value="2"]', 'Editor', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   188
		test_text	('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(3)[value="3"]', 'Moderator', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   189
		test_text	('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(4)[value="4"]', 'Commentator', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   190
		test_text	('#user_form tr:eq(1) td:eq(4) select[disabled] option:eq(5)[value="5"]', 'Observer', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   191
		test_val	('#user_form tr:eq(2) td:eq(4) select', '5'); // this is a bug should be 4
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   192
		test_val	('#user_form tr:eq(3) td:eq(4) select', '5'); // this is a bug should be 2
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   193
		test_val	('#user_form tr:eq(4) td:eq(4) select', '5');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   194
		test_exist	('#user_form tr:eq(6) td:eq(4) select');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   195
		test_count	('#user_form tr:eq(6) td:eq(4) select option', 3);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   196
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(0)[value=""][selected]', '---------', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   197
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(1)[value="4"]', 'Commentator', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   198
		test_text	('#user_form tr:eq(6) td:eq(4) select option:eq(2)[value="5"]', 'Observer', C.H);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   199
		test_exist	('#user_form tr:eq(1) td:eq(0) input[type=checkbox][disabled]');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   200
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(0)[href^="/user/"][href$="/edit/"]', 'Edit');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   201
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(1)[href^="/use"][href$="ontact/"]', 'Contact');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   202
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(2)[id^="user-suspend-"]', 'Suspend access');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   203
		test_text	('#user_form div.hidden-user-actions:eq(1) a:eq(3)[id^="user-resen"]', '(Re-)send invitation');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   204
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   205
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   206
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   207
	suite ('check user number', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   208
		test_page_loading	('/user/?display=1', 'People\' list\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   209
		test_count	('#user_form :input', 6 + (test_comt.user_nb % 10) * 2);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   210
		test_match	('#paginator', new RegExp ('\\s\\d+-\\d+ of '+test_comt.user_nb+'\\s','m'));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   211
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   212
641
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   213
	suite ('Reset fixture user roles', function () {
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   214
		test        ('set user-com Commentator', dsl(function () {
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   215
			input ('#user_form tr:eq(2) td:eq(4) select').option ('4');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   216
			input ('#user_form tr:eq(3) td:eq(4) select').option ('2');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   217
			input ('#user_form tr:eq(4) td:eq(4) select').option ('5');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   218
			input ('#save').prop ('disabled', false);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   219
		}));
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   220
		test_click	('#save', C.WAIT_PAGE_LOAD);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   221
		test_page_loading ('/user/', 'People\' list\n - '+C['#id_workspace_name']);
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   222
		test_val	('#user_form tr:eq(2) td:eq(4) select option:selected', '4');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   223
		test_val	('#user_form tr:eq(3) td:eq(4) select option:selected', '2');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   224
		test_val	('#user_form tr:eq(4) td:eq(4) select option:selected', '5');
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   225
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   226
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   227
		// TOTEST roles of users
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   228
		// TOTEST : filter by tag -> commentator user should be tagged commentator (to change in fixture)
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   229
		// TOTEST : pagination
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   230
		// TOTEST : Bulk Actions -> Apply does enable
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   231
		// TOTEST display suspended users
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   232
	});
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
   233
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   234
	suite ('add a user page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   235
		test_page_loading	('/user/add/', 'Add a new user\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   236
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   237
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   238
		test_count	('#user ul.sub_list:eq(0) a', 2);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   239
		test_text	('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   240
		test_text	('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   241
		test_count	('#user form[action="."]:eq(0) :input', 8);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   242
		test_field	('user', 'id_email',		'text', 0, 'E-mail address', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   243
		test_field	('user', 'id_first_name',	'text', 1, 'First name');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   244
		test_field	('user', 'id_last_name',	'text', 2, 'Last name');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   245
		test_field	('user', 'id_tags',			'text', 3, 'Tags');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   246
		test_field	('user', 'id_role',			'select', 4, 'Workspace level role');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   247
		test_field	('user', 'id_note',			'textarea', 5, 'Note');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   248
		test_count	('select#id_role option', 6);
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   249
		test_text	('select#id_role option:eq(0)[value][selected]', '---------', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   250
		test_text	('select#id_role option:eq(1)[value="1"]', 'Manager', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   251
		test_text	('select#id_role option:eq(2)[value="2"]', 'Editor', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   252
		test_text	('select#id_role option:eq(3)[value="3"]', 'Moderator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   253
		test_text	('select#id_role option:eq(4)[value="4"]', 'Commentator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   254
		test_text	('select#id_role option:eq(5)[value="5"]', 'Observer', C.HIDDEN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   255
		test_val	('#user :input:eq(6)[type=submit]', 'Add user');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   256
		test_val	('#user :input:eq(7)#cancel_button[type=button]', 'Cancel');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   257
		test_comt_unlogged_footer ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   258
		test_click	('#user input[type="submit"]', C.WAIT_PAGE_LOAD);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   259
		test_count	('div.help_text span.error-text', 1);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   260
		test_field	('user div.error', 'id_email', 'text', 0, 'E-mail address', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   261
		test_match	('#user div.help_text:eq(0) span.error-text:eq(0)', /This field is required/m);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   262
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   263
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   264
	suite ('add-users-in-bulk page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   265
		test_page_loading	('/user/mass-add/', 'Add users in bulk\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   266
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   267
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   268
		test_count	('#user ul.sub_list:eq(0) a', 2);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   269
		test_text	('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   270
		test_text	('#user ul.sub_list:eq(0) a:eq(1)[href="/user/add/"]', 'Add a new user');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   271
		test_count	('#user form[action="."]:eq(0) :input', 6);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   272
		test_field	('user', 'id_email',		'textarea', 0, 'Emails', true);
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   273
		test_field	('user', 'id_tags',			'text',		1, 'Tags');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   274
		test_field	('user', 'id_role',			'select',	2, 'Workspace level role');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   275
		test_field	('user', 'id_note',			'textarea', 3, 'Note');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   276
		test_count	('select#id_role option', 6);
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   277
		test_text	('select#id_role option:eq(0)[value][selected]', '---------', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   278
		test_text	('select#id_role option:eq(1)[value="1"]', 'Manager', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   279
		test_text	('select#id_role option:eq(2)[value="2"]', 'Editor', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   280
		test_text	('select#id_role option:eq(3)[value="3"]', 'Moderator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   281
		test_text	('select#id_role option:eq(4)[value="4"]', 'Commentator', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   282
		test_text	('select#id_role option:eq(5)[value="5"]', 'Observer', C.HIDDEN);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   283
		test_val	('#user :input:eq(4)[type=submit]', 'Add users');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   284
		test_val	('#user :input:eq(5)#cancel_button[type=button]', 'Cancel');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   285
		// X TOTEST add users (pending) -> can't be deleted
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   286
		test_comt_unlogged_footer ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   287
		test_click	('#user input[type="submit"]', C.WAIT_PAGE_LOAD);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   288
		test_count	('div.help_text span.error-text', 1);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   289
		test_field	('user div.error', 'id_email', 'textarea', 0, 'Emails', true);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   290
		test_match	('#user div.help_text:eq(0) span.error-text:eq(0)', /This field is required/m);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   291
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   292
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   293
	suite ('settings page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   294
		test_page_loading	('/settings/', 'Settings - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   295
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   296
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   297
		test_count	('#settings ul.sub_list:eq(0) a', 1);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   298
		test_text	('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/design/"]', 'Appearance');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   299
		test_count	('#settings form[action="."]:eq(0) :input', 12);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   300
		test_field	('settings', 'id_workspace_name', 'text', 0, 'Workspace name');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   301
		test_field	('settings', 'id_workspace_tagline', 'text', 1, 'Workspace tagline');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   302
		test_field	('settings', 'id_workspace_registration', 'checkbox', 2, 'Workspace registration');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   303
		test_field	('settings', 'id_workspace_registration_moderation', 'checkbox', 3, 'Workspace registration moderation');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   304
		test_field	('settings', 'id_workspace_role_model', 'select', 4, 'Role model');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   305
		test_text	('select#id_workspace_role_model option:eq(0)[selected][value="generic"]', 'Generic', C.HIDDEN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   306
		test_text	('select#id_workspace_role_model option:eq(1)[value="teacher"]', 'Class (education)', C.HIDDEN);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   307
		test_field	('settings', 'id_workspace_category_1', 'text', 5, 'Label for the first category of comments');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   308
		test_field	('settings', 'id_workspace_category_2', 'text', 6, 'Label for the second category of comments');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   309
		test_field	('settings', 'id_workspace_category_3', 'text', 7, 'Label for the third category of comments');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   310
		test_field	('settings', 'id_workspace_category_4', 'text', 8, 'Label for the fourth category of comments');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   311
		test_field	('settings', 'id_workspace_category_5', 'text', 9, 'Label for the fifth category of comments');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   312
		test_val	('#settings :input:eq(10)[type=submit]', 'Save');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   313
		test_val	('#settings :input:eq(11)#cancel_button[type=button]', 'Cancel');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   314
		// TOTEST Workspace registration feature (with newly accessible page)
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   315
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   316
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   317
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   318
	suite ('settings design page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   319
		test_page_loading	('/settings/design/', 'Settings - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   320
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   321
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   322
		test_count	('#settings ul.sub_list:eq(0) a', 1);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   323
		test_text	('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/"]', 'General');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   324
		test_count	('#settings form[action="."]:eq(0) :input', 7);
633
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   325
		test_field	('settings', 'id_workspace_logo_file', 'file', 0, 'Workspace logo');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   326
		test_field	('settings', 'id_custom_css', 'textarea', 1, 'Custom CSS rules');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   327
		test_field	('settings', 'id_custom_font', 'text', 2, 'Custom font');
44634d19db32 More text list tests : filter by tag, hidden links…
Simon Descarpentries <sid@sopinspace.com>
parents: 627
diff changeset
   328
		test_field	('settings', 'id_custom_titles_font', 'text', 3, 'Custom font for titles');
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   329
		test_val	('#settings :input:eq(4)[type=submit]', 'Save');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   330
		test_val	('#settings :input:eq(5)#cancel_button[type=button]', 'Cancel');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   331
		test_val	('#settings :input:eq(6)#delete_logo_button[type=submit]', 'Delete logo');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   332
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   333
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   334
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   335
	suite ('followup page conformity', function () {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   336
		test_page_loading	('/followup/', 'Followup\n - '+C['#id_workspace_name']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   337
		test_comt_logged_header	(C.W.USER_ADMIN);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   338
		test_comt_default_tabs	(test_comt.text_nb, test_comt.user_nb);
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   339
		test_text	('#followup a:eq(0)[href="/help/#public_private_feed"]', '?');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   340
		test_match	('#followup a:eq(1)[href$="/feed/"]', new RegExp (C.W.WORKSPACE_URL+'feed/', 'm'));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   341
		test_text	('#followup a:eq(2)[href="/help/#public_private_feed"]', '?');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   342
		test_count	('form#followup_form[action="."] :input', 3);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   343
		test_val	('form#followup_form input[type=submit]', '(Activate private feed|Reset private feed url)');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   344
		test_val	('form#followup_form input#workspace_notify_check[type=checkbox]', 'on');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   345
		test_val	('form#followup_form input#own_notify_check[type=checkbox]', 'on');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   346
	
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   347
		// X TOTEST qu'une fois cliqué, le bouton a le nvo label, et qu'une adresse est disponible
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   348
		// X TOTEST que si on reclique l'adresse est changée
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   349
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   350
		test_comt_unlogged_footer ();
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   351
	});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   352
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   353
});
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   354