test-suite/tests/001_comt_test_utils.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
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     3
// set tabstop=4          " number of spaces in a tab
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     4
// set softtabstop=4      " as above
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     5
// set shiftwidth=4       " as above
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     6
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     7
/**
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     8
 * Constants and variables
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
     9
 */
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    10
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    11
var test_comt = { 'text_nb': 0,	'user_nb': 4 };
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    12
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    13
const C = { 'HIDDEN': false,
641
8f7dafe42d15 Refine user list tests
Simon Descarpentries <sid@sopinspace.com>
parents: 638
diff changeset
    14
	'H': false,
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    15
	'NO_TAGLINE': false,
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    16
	'WAIT_PAGE_LOAD': true,
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    17
	'W': __karma__.config.W,
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    18
	'#id_workspace_name':	'Test workspace name',
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    19
	'#id_workspace_tagline':	'Test workspace tagline',
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    20
	'#id_workspace_registration':			'on',	// registration
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    21
	'#id_workspace_registration_moderation':'on',	// registration moderation
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    22
	'#id_workspace_role_model': 'generic',
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    23
	'#id_workspace_category_1': 'ws_cat_1',
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    24
	'#id_workspace_category_2': 'ws_cat_2',
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    25
	'#id_workspace_category_3': 'ws_cat_3',
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    26
	'#id_workspace_category_4': 'ws_cat_4',
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    27
	'#id_workspace_category_5': 'ws_cat_5',
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    28
	'#id_custom_css': "h2 {  font-family: Test_Sopinspace !important; }",
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    29
	'#id_custom_font': 'Test_Sopinspace_custom_font',
637
71d87ca43d6a Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents: 636
diff changeset
    30
	'#id_custom_titles_font': 'Test_Sopinspace_custom_titles_font'
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    31
};
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    32
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    33
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    34
/**
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    35
 * COMT test API
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    36
 */
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    37
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    38
function test_comt_login (user, pass) {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    39
	test ('with '+user+' - '+pass, dsl(function () {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    40
		browser.navigateTo ('/');
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    41
		input ('#id_username').enter (user);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    42
		input ('#id_password').enter (pass);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    43
		elt ('#login input[type=submit]').click ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    44
		browser.waitForPageLoad (); // Must be done here in this test() block
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    45
		browser.navigateTo ('/');
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    46
		expect (element ('title').text ()).toMatch (/Dashboard/m);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    47
	}));
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    48
}
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    49
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    50
function test_comt_logout () {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    51
	test_page_loading ('/logout/', 'Home - '+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
    52
};
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    53
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    54
function test_comt_create_text (t) {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    55
	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
    56
	test ('test creation', dsl(function () {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    57
		dropdownlist ('#id_format').option (t['#id_format']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    58
	}));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    59
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    60
	test_fill_field ('#id_title', t);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    61
	test ('fill content', dsl(function (){
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    62
		elt ('#id_content').val (t['#id_content']);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    63
	}));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    64
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    65
	test_fill_field ('#id_tags', t);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    66
	test_click	 ('#save_button', C.WAIT_PAGE_LOAD);
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    67
	test_comt.text_nb++;
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    68
}
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    69
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    70
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    71
/**
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    72
 * Other factorized tests
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    73
 */
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    74
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    75
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    76
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    77
function test_comt_default_tabs (txt_nb, usr_nb) {
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    78
	test_count	('#main-tabs a', 5);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    79
	test_text	('#main-tabs li:nth-of-type(1) a[href="/"]',			'Dashboard');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    80
	test_match	('#main-tabs li:nth-of-type(2) a[href="/text/"]',		/^Texts \(\d+\) $/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    81
	test_match	('#main-tabs li:nth-of-type(3) a[href="/user/"]',		/^People  \(\d+\)$/);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    82
	test_text	('#main-tabs li:nth-of-type(4) a[href="/settings/"]',	'Settings');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    83
	test_text	('#main-tabs li:nth-of-type(5) a[href="/followup/"]',	'Followup');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    84
	test_match	('#main-tabs a[href="/text/"]', new RegExp ('^Texts\\s*\\('+txt_nb+'\\)\\s*$'));
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    85
	test_match	('#main-tabs a[href="/user/"]', new RegExp ('^People\\s*\\('+usr_nb+'\\)\\s*$'));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    86
}
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    87
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    88
function test_comt_logged_header (username, is_tagline) {
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    89
	is_tagline = typeof is_tagline == 'undefined' ? true : is_tagline;
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    90
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    91
	test_text	('#header_controls b', username)
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    92
	test_count	('#header_controls a', 6);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    93
	test_text	('#header_controls a:nth-of-type(1)[href="/"]',					'Home');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    94
	test_text	('#header_controls a:nth-of-type(2)[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
    95
	test_text	('#header_controls a:nth-of-type(3)[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
    96
	test_text	('#header_controls a:nth-of-type(4)[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
    97
	test_text	('#header_controls a:nth-of-type(5)[href="/profile/"]',			'Profile');
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    98
	test_text	('#header_controls a:nth-of-type(6)[href="/logout/"]',			'Logout');
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
    99
	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
   100
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   101
	if (is_tagline) {
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   102
		test_match	('#content h1.main_title  + div', new RegExp (C['#id_workspace_tagline'], 'm'));
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   103
	}
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
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   106
function test_comt_fill_settings (s) {
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   107
	test_fill_field ('#id_workspace_name', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   108
	test_fill_field ('#id_workspace_tagline', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   109
	test_fill_field ('#id_workspace_registration', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   110
	test_fill_field ('#id_workspace_registration_moderation', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   111
	test_fill_field ('#id_workspace_role_model', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   112
	test_fill_field ('#id_workspace_category_1', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   113
	test_fill_field ('#id_workspace_category_2', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   114
	test_fill_field ('#id_workspace_category_3', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   115
	test_fill_field ('#id_workspace_category_4', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   116
	test_fill_field ('#id_workspace_category_5', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   117
}
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   118
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   119
function test_comt_fill_design (s) {
627
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   120
	test_fill_field ('#id_custom_css', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   121
	test_fill_field ('#id_custom_font', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   122
	test_fill_field ('#id_custom_titles_font', s);
7d93eccbb565 Move helpers somewhere less trickier, test pagination with 12 texts
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
   123
}
638
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   124
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   125
/** Test if it's possible to change lang to the specified :
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   126
 *  c : lang code
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   127
 *  l : help label
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   128
 */
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   129
function test_comt_i18n (c, l) {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   130
    test ('to '+c, dsl(function () {
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   131
        element ('#footer a[href="/i18n/setlang/'+c+'/"]').click ();
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   132
        browser.navigateTo ('/');
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   133
        expect (elt ('#footer a[href="/help/"]').text ()).toMatch (new RegExp (l, 'm'));
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   134
    }));
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   135
}
61dc5370b351 start building a COMT test API, automate testserver starting and stopping
Simon Descarpentries <sid@sopinspace.com>
parents: 637
diff changeset
   136