test-suite/tests/001_comt_test_utils.js
changeset 656 a84519031134
parent 646 24067001082c
equal deleted inserted replaced
655:cac6781d8b7f 656:a84519031134
   133 
   133 
   134 function test_comt_logged_header (username, is_tagline) {
   134 function test_comt_logged_header (username, is_tagline) {
   135 	is_tagline = typeof is_tagline == 'undefined' ? true : is_tagline;
   135 	is_tagline = typeof is_tagline == 'undefined' ? true : is_tagline;
   136 
   136 
   137 	test_text	('#header_controls b', username)
   137 	test_text	('#header_controls b', username)
   138 	test_count	('#header_controls a', 6);
   138 	test_count	('#header_controls a', 7);
   139 	test_text	('#header_controls a:nth-of-type(1)[href="/"]',					'Home');
   139 	test_text	('#header_controls a:nth-of-type(1)[href="/"]',					'Home');
   140 	test_text	('#header_controls a:nth-of-type(2)[href="/create/content/"]',	'Create a text');
   140 	test_text	('#header_controls a:nth-of-type(2)[href="/create/content/"]',	'Create a text');
   141 	test_text	('#header_controls a:nth-of-type(3)[href="/create/upload/"]',	'Upload a text');
   141 	test_text	('#header_controls a:nth-of-type(3)[href="/create/upload/"]',	'Upload a text');
   142 	test_text	('#header_controls a:nth-of-type(4)[href="/create/import/"]',	'Import a co-mented text');
   142 	test_text	('#header_controls a:nth-of-type(4)[href="/create/import/"]',	'Import a co-mented text');
   143 	test_text	('#header_controls a:nth-of-type(5)[href="/profile/"]',			'Profile');
   143 	test_text	('#header_controls a:nth-of-type(5)[href="/profile/"]',			'Profile');
   144 	test_text	('#header_controls a:nth-of-type(6)[href="/logout/"]',			'Logout');
   144 	test_text	('#header_controls a:nth-of-type(6)#hide-piwik-cookies-optout',	'Privacy policy ');
       
   145 	test_text	('#header_controls a:nth-of-type(7)[href="/logout/"]',			'Logout');
   145 	test_text	('#content h1.main_title a[href="/"]',							C['#id_workspace_name']);
   146 	test_text	('#content h1.main_title a[href="/"]',							C['#id_workspace_name']);
   146 
   147 
   147 	if (is_tagline) {
   148 	if (is_tagline) {
   148 		test_match	('#content h1.main_title  + div', new RegExp (C['#id_workspace_tagline'], 'm'));
   149 		test_match	('#content h1.main_title  + div', new RegExp (C['#id_workspace_tagline'], 'm'));
   149 	}
   150 	}