|
Lines 234-240
sub test_search{
Link Here
|
| 234 |
|
234 |
|
| 235 |
$agent->follow_link_ok( { text => 'Manage staged records' }, 'view batch' ); |
235 |
$agent->follow_link_ok( { text => 'Manage staged records' }, 'view batch' ); |
| 236 |
|
236 |
|
| 237 |
|
|
|
| 238 |
$agent->form_number(6); |
237 |
$agent->form_number(6); |
| 239 |
$agent->field( 'framework', '' ); |
238 |
$agent->field( 'framework', '' ); |
| 240 |
$agent->click_ok( 'mainformsubmit', "imported records into catalog" ); |
239 |
$agent->click_ok( 'mainformsubmit', "imported records into catalog" ); |
|
Lines 249-256
sub test_search{
Link Here
|
| 249 |
|
248 |
|
| 250 |
# --------------------------------- TEST INTRANET SEARCH |
249 |
# --------------------------------- TEST INTRANET SEARCH |
| 251 |
|
250 |
|
| 252 |
|
|
|
| 253 |
$agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet"); |
251 |
$agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet"); |
|
|
252 |
sleep 1; |
| 253 |
|
| 254 |
$agent->form_number(5); |
254 |
$agent->form_number(5); |
| 255 |
$agent->field('idx', 'kw'); |
255 |
$agent->field('idx', 'kw'); |
| 256 |
$agent->field('q', $search_key); |
256 |
$agent->field('q', $search_key); |
|
Lines 262-309
sub test_search{
Link Here
|
| 262 |
my $xslt_filepath = C4::XSLT::_get_best_default_xslt_filename( C4::Context->config('intrahtdocs'), C4::Context->preference("template"), 'en', $xslt_file ); |
262 |
my $xslt_filepath = C4::XSLT::_get_best_default_xslt_filename( C4::Context->config('intrahtdocs'), C4::Context->preference("template"), 'en', $xslt_file ); |
| 263 |
return sprintf( "===DIAG===\n%s is %s\n%s %s\n==========", $pref, C4::Context->preference($pref), $xslt_filepath, ( -f $xslt_filepath ? 'exists' : 'does not exist' )); |
263 |
return sprintf( "===DIAG===\n%s is %s\n%s %s\n==========", $pref, C4::Context->preference($pref), $xslt_filepath, ( -f $xslt_filepath ? 'exists' : 'does not exist' )); |
| 264 |
}; |
264 |
}; |
|
|
265 |
sleep 1; |
| 266 |
like( $intra_text, qr|Publication details: $publisher|, "test staff 'kw' search" ) or diag($diag->()); |
| 265 |
|
267 |
|
| 266 |
like( $intra_text, qr|Publication details: $publisher|, ) or diag($diag->()); |
268 |
$agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet2"); |
| 267 |
|
|
|
| 268 |
$agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet"); |
| 269 |
$agent->form_number(5); |
269 |
$agent->form_number(5); |
| 270 |
$agent->field('idx', 'kw'); |
270 |
$agent->field('idx', 'kw'); |
| 271 |
$agent->field('q', $publisher); |
271 |
$agent->field('q', $publisher); |
| 272 |
$agent->click(); |
272 |
$agent->click(); |
| 273 |
$intra_text = $agent->text(); |
273 |
$intra_text = $agent->text(); |
| 274 |
|
274 |
|
| 275 |
like( $intra_text, qr|Publication details: $publisher|, ); |
275 |
sleep 1; |
|
|
276 |
like( $intra_text, qr|Publication details: $publisher|, "test staff 'kw' search 2" ); |
| 276 |
my $expected_base = q|search.pl\?advsearch=1&idx=kw&q=| . uri_escape_utf8( $publisher ); |
277 |
my $expected_base = q|search.pl\?advsearch=1&idx=kw&q=| . uri_escape_utf8( $publisher ); |
| 277 |
$agent->base_like(qr|$expected_base|, ); |
278 |
$agent->base_like(qr|$expected_base|, ); |
| 278 |
|
279 |
|
|
|
280 |
sleep 1; |
| 279 |
ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ; |
281 |
ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ; |
|
|
282 |
sleep 1; |
| 280 |
ok ($intra_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); |
283 |
ok ($intra_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); |
| 281 |
# -------------------------------------------------- TEST ON OPAC |
284 |
# -------------------------------------------------- TEST ON OPAC |
| 282 |
|
285 |
|
|
|
286 |
sleep 1; |
| 283 |
$agent->get_ok( "$opac" , "got opac"); |
287 |
$agent->get_ok( "$opac" , "got opac"); |
| 284 |
$agent->form_name('searchform'); |
288 |
$agent->form_name('searchform'); |
| 285 |
$agent->field( 'q', $search_key ); |
289 |
$agent->field( 'q', $search_key ); |
| 286 |
$agent->field( 'idx', '' ); |
290 |
$agent->field( 'idx', '' ); |
| 287 |
$agent->click( ); |
291 |
$agent->click( ); |
| 288 |
my $opac_text = $agent->text() ; |
292 |
my $opac_text = $agent->text() ; |
| 289 |
like( $opac_text, qr|Publication details: $publisher|, ); |
293 |
like( $opac_text, qr|Publication details: $publisher|, 'test opac default search' ); |
| 290 |
|
294 |
|
| 291 |
$agent->get_ok( "$opac" , "got opac"); |
295 |
sleep 1; |
|
|
296 |
$agent->get_ok( "$opac" , "got opac2"); |
| 292 |
$agent->form_name('searchform'); |
297 |
$agent->form_name('searchform'); |
| 293 |
$agent->field('q', $publisher); |
298 |
$agent->field('q', $publisher); |
| 294 |
$agent->field( 'idx', '' ); |
299 |
$agent->field( 'idx', '' ); |
| 295 |
$agent->click(); |
300 |
$agent->click(); |
| 296 |
$opac_text = $agent->text(); |
301 |
$opac_text = $agent->text(); |
| 297 |
|
302 |
|
| 298 |
like( $opac_text, qr|Publication details: $publisher|, ); |
303 |
sleep 1; |
|
|
304 |
like( $opac_text, qr|Publication details: $publisher|, 'test opac default search 2' ); |
| 299 |
$expected_base = q|opac-search.pl\?(idx=&)?q=| . uri_escape_utf8( $publisher ); |
305 |
$expected_base = q|opac-search.pl\?(idx=&)?q=| . uri_escape_utf8( $publisher ); |
| 300 |
$agent->base_like(qr|$expected_base|, ); |
306 |
$agent->base_like(qr|$expected_base|, ); |
| 301 |
# Test added on BZ 14909 in addition to making the empty idx= optional |
307 |
# Test added on BZ 14909 in addition to making the empty idx= optional |
| 302 |
# in the previous regex |
308 |
# in the previous regex |
| 303 |
$agent->base_unlike( qr|idx=\w+|, 'Base does not contain an idx' ); |
309 |
$agent->base_unlike( qr|idx=\w+|, 'Base does not contain an idx' ); |
| 304 |
|
310 |
|
| 305 |
|
311 |
sleep 1; |
| 306 |
ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Good') ; |
312 |
ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Good') ; |
|
|
313 |
sleep 1; |
| 307 |
ok ($opac_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); |
314 |
ok ($opac_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); |
| 308 |
|
315 |
|
| 309 |
#-------------------------------------------------- REVERT |
316 |
#-------------------------------------------------- REVERT |
|
Lines 318-324
sub test_search{
Link Here
|
| 318 |
cleanup(); |
325 |
cleanup(); |
| 319 |
} |
326 |
} |
| 320 |
|
327 |
|
| 321 |
|
|
|
| 322 |
# function that launches the zebra daemon |
328 |
# function that launches the zebra daemon |
| 323 |
sub launch_zebra { |
329 |
sub launch_zebra { |
| 324 |
|
330 |
|
| 325 |
- |
|
|