Lines 239-245
subtest 'Search patrons' => sub {
Link Here
|
239 |
# NOTE: We should probably ensure the bad field is removed from 'standard' search here, else searches are broken |
239 |
# NOTE: We should probably ensure the bad field is removed from 'standard' search here, else searches are broken |
240 |
C4::Context->set_preference('DefaultPatronSearchFields',""); |
240 |
C4::Context->set_preference('DefaultPatronSearchFields',""); |
241 |
$driver->get( $base_url . "/members/members-home.pl" ); |
241 |
$driver->get( $base_url . "/members/members-home.pl" ); |
242 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
242 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
243 |
$s->submit_form; |
243 |
$s->submit_form; |
244 |
my $first_patron = Koha::Patrons->search( { surname => { like => 'test_patron_%' } } )->next; |
244 |
my $first_patron = Koha::Patrons->search( { surname => { like => 'test_patron_%' } } )->next; |
245 |
|
245 |
|
Lines 276-282
subtest 'Search patrons' => sub {
Link Here
|
276 |
); |
276 |
); |
277 |
|
277 |
|
278 |
$driver->get( $base_url . "/members/members-home.pl" ); |
278 |
$driver->get( $base_url . "/members/members-home.pl" ); |
279 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
279 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
280 |
$s->submit_form; |
280 |
$s->submit_form; |
281 |
sleep $DT_delay && $s->wait_for_ajax; |
281 |
sleep $DT_delay && $s->wait_for_ajax; |
282 |
|
282 |
|
Lines 297-303
subtest 'Search patrons' => sub {
Link Here
|
297 |
is( $driver->find_element('//div[@id="'.$table_id.'_info"]')->get_text, sprintf('Showing 1 to %s of %s entries', $PatronsPerPage, $total_number_of_patrons), 'Resetting filters works as expected' ); |
297 |
is( $driver->find_element('//div[@id="'.$table_id.'_info"]')->get_text, sprintf('Showing 1 to %s of %s entries', $PatronsPerPage, $total_number_of_patrons), 'Resetting filters works as expected' ); |
298 |
|
298 |
|
299 |
# Pattern terms must be split |
299 |
# Pattern terms must be split |
300 |
$s->fill_form( { 'class=search_patron_filter' => 'test patron' } ); |
300 |
$s->fill_form( { 'search_patron_filter' => 'test patron' } ); |
301 |
$s->submit_form; |
301 |
$s->submit_form; |
302 |
|
302 |
|
303 |
sleep $DT_delay && $s->wait_for_ajax; |
303 |
sleep $DT_delay && $s->wait_for_ajax; |
Lines 307-313
subtest 'Search patrons' => sub {
Link Here
|
307 |
sleep $DT_delay && $s->wait_for_ajax; |
307 |
sleep $DT_delay && $s->wait_for_ajax; |
308 |
|
308 |
|
309 |
# Search on non-searchable attribute, we expect no result! |
309 |
# Search on non-searchable attribute, we expect no result! |
310 |
$s->fill_form( { 'class=search_patron_filter' => 'test_attr_1' } ); |
310 |
$s->fill_form( { 'search_patron_filter' => 'test_attr_1' } ); |
311 |
$s->submit_form; |
311 |
$s->submit_form; |
312 |
sleep $DT_delay && $s->wait_for_ajax; |
312 |
sleep $DT_delay && $s->wait_for_ajax; |
313 |
|
313 |
|
Lines 317-323
subtest 'Search patrons' => sub {
Link Here
|
317 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
317 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
318 |
|
318 |
|
319 |
# Search on searchable attribute, we expect 2 patrons |
319 |
# Search on searchable attribute, we expect 2 patrons |
320 |
$s->fill_form( { 'class=search_patron_filter' => 'test_attr_2' } ); |
320 |
$s->fill_form( { 'search_patron_filter' => 'test_attr_2' } ); |
321 |
$s->submit_form; |
321 |
$s->submit_form; |
322 |
sleep $DT_delay && $s->wait_for_ajax; |
322 |
sleep $DT_delay && $s->wait_for_ajax; |
323 |
|
323 |
|
Lines 326-332
subtest 'Search patrons' => sub {
Link Here
|
326 |
# clear form |
326 |
# clear form |
327 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
327 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
328 |
|
328 |
|
329 |
$s->fill_form( { 'class=search_patron_filter' => 'test_attr_3' } ); # Terms must be split |
329 |
$s->fill_form( { 'search_patron_filter' => 'test_attr_3' } ); # Terms must be split |
330 |
$s->submit_form; |
330 |
$s->submit_form; |
331 |
sleep $DT_delay && $s->wait_for_ajax; |
331 |
sleep $DT_delay && $s->wait_for_ajax; |
332 |
|
332 |
|
Lines 336-342
subtest 'Search patrons' => sub {
Link Here
|
336 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
336 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="btn btn-default clear_search"]')->click(); |
337 |
|
337 |
|
338 |
# Search on searchable attribute as specific field, we expect 2 patrons |
338 |
# Search on searchable attribute as specific field, we expect 2 patrons |
339 |
$s->fill_form( { 'class=search_patron_filter' => 'test_attr_4' } ); |
339 |
$s->fill_form( { 'search_patron_filter' => 'test_attr_4' } ); |
340 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="searchfieldstype_filter"]//option[@value="_ATTR_'.$attribute_type_searchable_not_default->code.'"]')->click(); |
340 |
$driver->find_element('//form[@class="patron_search_form"]//*[@class="searchfieldstype_filter"]//option[@value="_ATTR_'.$attribute_type_searchable_not_default->code.'"]')->click(); |
341 |
$s->submit_form; |
341 |
$s->submit_form; |
342 |
sleep $DT_delay && $s->wait_for_ajax; |
342 |
sleep $DT_delay && $s->wait_for_ajax; |
Lines 361-367
subtest 'Search patrons' => sub {
Link Here
|
361 |
|
361 |
|
362 |
C4::Context->set_preference( 'PatronsPerPage', 5 ); |
362 |
C4::Context->set_preference( 'PatronsPerPage', 5 ); |
363 |
$driver->get( $base_url . "/members/members-home.pl" ); |
363 |
$driver->get( $base_url . "/members/members-home.pl" ); |
364 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
364 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
365 |
$s->submit_form; |
365 |
$s->submit_form; |
366 |
sleep $DT_delay && $s->wait_for_ajax; |
366 |
sleep $DT_delay && $s->wait_for_ajax; |
367 |
my $patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text; |
367 |
my $patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text; |
Lines 387-393
subtest 'Search patrons' => sub {
Link Here
|
387 |
|
387 |
|
388 |
# Perform another search |
388 |
# Perform another search |
389 |
$driver->get( $base_url . "/members/members-home.pl" ); |
389 |
$driver->get( $base_url . "/members/members-home.pl" ); |
390 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
390 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
391 |
$s->submit_form; |
391 |
$s->submit_form; |
392 |
sleep $DT_delay && $s->wait_for_ajax; |
392 |
sleep $DT_delay && $s->wait_for_ajax; |
393 |
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text; |
393 |
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text; |
Lines 414-420
subtest 'Search patrons' => sub {
Link Here
|
414 |
# We have a patron with date of birth=1980-06-17 => formatted as 17/06/1980 |
414 |
# We have a patron with date of birth=1980-06-17 => formatted as 17/06/1980 |
415 |
|
415 |
|
416 |
$driver->get( $base_url . "/members/members-home.pl" ); |
416 |
$driver->get( $base_url . "/members/members-home.pl" ); |
417 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
417 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
418 |
$s->submit_form; |
418 |
$s->submit_form; |
419 |
sleep $DT_delay && $s->wait_for_ajax; |
419 |
sleep $DT_delay && $s->wait_for_ajax; |
420 |
|
420 |
|
Lines 491-497
subtest 'Search patrons in modal' => sub {
Link Here
|
491 |
$s->wait_for_element_visible('//div[@id="patron_search_modal"]//div[@class="modal-header"]'); |
491 |
$s->wait_for_element_visible('//div[@id="patron_search_modal"]//div[@class="modal-header"]'); |
492 |
|
492 |
|
493 |
# Search for our test patrons |
493 |
# Search for our test patrons |
494 |
$s->fill_form( { 'class=search_patron_filter' => 'test_patron' } ); |
494 |
$s->fill_form( { 'search_patron_filter' => 'test_patron' } ); |
495 |
$s->submit_form; |
495 |
$s->submit_form; |
496 |
sleep $DT_delay && $s->wait_for_ajax; |
496 |
sleep $DT_delay && $s->wait_for_ajax; |
497 |
|
497 |
|
Lines 582-588
subtest 'Search patrons in modal' => sub {
Link Here
|
582 |
$s->wait_for_element_visible('//div[@id="patron_search_modal_owner"]//div[@class="modal-header"]'); |
582 |
$s->wait_for_element_visible('//div[@id="patron_search_modal_owner"]//div[@class="modal-header"]'); |
583 |
|
583 |
|
584 |
# Search for our test patrons |
584 |
# Search for our test patrons |
585 |
$driver->find_element('//div[@id="patron_search_modal_owner"]//input[@class="search_patron_filter"]') |
585 |
$driver->find_element('//div[@id="patron_search_modal_owner"]//input[@id="search_patron_filter"]') |
586 |
->send_keys('test_patron'); |
586 |
->send_keys('test_patron'); |
587 |
$driver->find_element('//div[@id="patron_search_modal_owner"]//input[@type="submit"]')->click; |
587 |
$driver->find_element('//div[@id="patron_search_modal_owner"]//input[@type="submit"]')->click; |
588 |
|
588 |
|
Lines 644-650
subtest 'Search patrons in modal' => sub {
Link Here
|
644 |
$s->wait_for_element_visible('//div[@id="patron_search_modal_users"]//div[@class="modal-header"]'); |
644 |
$s->wait_for_element_visible('//div[@id="patron_search_modal_users"]//div[@class="modal-header"]'); |
645 |
|
645 |
|
646 |
# Search for our test patrons |
646 |
# Search for our test patrons |
647 |
$driver->find_element('//div[@id="patron_search_modal_users"]//input[@class="search_patron_filter"]') |
647 |
$driver->find_element('//div[@id="patron_search_modal_users"]//input[@id="search_patron_filter"]') |
648 |
->send_keys('test_patron'); |
648 |
->send_keys('test_patron'); |
649 |
$driver->find_element('//div[@id="patron_search_modal_users"]//input[@type="submit"]')->click; |
649 |
$driver->find_element('//div[@id="patron_search_modal_users"]//input[@type="submit"]')->click; |
650 |
|
650 |
|
651 |
- |
|
|