Lines 51-57
my $base_url = $s->base_url;
Link Here
|
51 |
my $builder = t::lib::TestBuilder->new; |
51 |
my $builder = t::lib::TestBuilder->new; |
52 |
|
52 |
|
53 |
subtest 'Search patrons' => sub { |
53 |
subtest 'Search patrons' => sub { |
54 |
plan tests => 23; |
54 |
plan tests => 24; |
55 |
|
55 |
|
56 |
if ( Koha::Patrons->search({surname => {-like => "test_patron_%"}})->count ) { |
56 |
if ( Koha::Patrons->search({surname => {-like => "test_patron_%"}})->count ) { |
57 |
BAIL_OUT("Cannot run this test, data we need to create already exist in the DB"); |
57 |
BAIL_OUT("Cannot run this test, data we need to create already exist in the DB"); |
Lines 91-96
subtest 'Search patrons' => sub {
Link Here
|
91 |
} |
91 |
} |
92 |
); |
92 |
); |
93 |
} |
93 |
} |
|
|
94 |
|
95 |
push @patrons, $builder->build_object( |
96 |
{ |
97 |
class => 'Koha::Patrons', |
98 |
value => { |
99 |
surname => "test", |
100 |
firstname => "not_p_a_t_r_o_n", # won't match 'patron' |
101 |
categorycode => $patron_category->categorycode, |
102 |
branchcode => $library->branchcode, |
103 |
borrowernotes => $borrowernotes, |
104 |
address => $address, |
105 |
email => $email, |
106 |
} |
107 |
} |
108 |
); |
109 |
|
94 |
my $library_2 = $builder->build_object( |
110 |
my $library_2 = $builder->build_object( |
95 |
{ class => 'Koha::Libraries', value => { branchname => 'X' . $branchname } } |
111 |
{ class => 'Koha::Libraries', value => { branchname => 'X' . $branchname } } |
96 |
); |
112 |
); |
Lines 221-226
subtest 'Search patrons' => sub {
Link Here
|
221 |
# And make sure all the patrons are present |
237 |
# And make sure all the patrons are present |
222 |
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' ); |
238 |
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' ); |
223 |
|
239 |
|
|
|
240 |
# Pattern terms must be split |
241 |
$s->fill_form( { search_patron_filter => 'test patron' } ); |
242 |
$s->submit_form; |
243 |
|
244 |
$s->wait_for_ajax; |
245 |
is( $driver->find_element('//div[@id="'.$table_id.'_info"]')->get_text, sprintf('Showing 1 to %s of %s entries (filtered from %s total entries)', $PatronsPerPage, 26, $total_number_of_patrons) ); |
246 |
$driver->find_element('//form[@id="patron_search_form"]//*[@id="clear_search"]')->click(); |
247 |
$s->submit_form; |
248 |
$s->wait_for_ajax; |
249 |
|
224 |
# Search on non-searchable attribute, we expect no result! |
250 |
# Search on non-searchable attribute, we expect no result! |
225 |
$s->fill_form( { search_patron_filter => 'test_attr_1' } ); |
251 |
$s->fill_form( { search_patron_filter => 'test_attr_1' } ); |
226 |
$s->submit_form; |
252 |
$s->submit_form; |
227 |
- |
|
|