Lines 164-171
subtest 'Search patrons' => sub {
Link Here
|
164 |
$s->auth; |
164 |
$s->auth; |
165 |
C4::Context->set_preference('DefaultPatronSearchFields',""); |
165 |
C4::Context->set_preference('DefaultPatronSearchFields',""); |
166 |
C4::Context->set_preference('DefaultPatronSearchMethod',"contains"); |
166 |
C4::Context->set_preference('DefaultPatronSearchMethod',"contains"); |
|
|
167 |
my $searchable_attributes = Koha::Patron::Attribute::Types->search({ staff_searchable => 1 })->count(); |
167 |
my $PatronsPerPage = 15; |
168 |
my $PatronsPerPage = 15; |
168 |
my $nb_standard_fields = 13; |
169 |
my $nb_standard_fields = 13 + $searchable_attributes; # Standard fields, plus one searchable attribute |
169 |
C4::Context->set_preference('PatronsPerPage', $PatronsPerPage); |
170 |
C4::Context->set_preference('PatronsPerPage', $PatronsPerPage); |
170 |
$driver->get( $base_url . "/members/members-home.pl" ); |
171 |
$driver->get( $base_url . "/members/members-home.pl" ); |
171 |
my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
172 |
my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
Lines 182-188
subtest 'Search patrons' => sub {
Link Here
|
182 |
@filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
183 |
@filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
183 |
is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field'); |
184 |
is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field'); |
184 |
is( $filter_options[0]->get_value(), 'standard', 'Standard filter uses value "standard"'); |
185 |
is( $filter_options[0]->get_value(), 'standard', 'Standard filter uses value "standard"'); |
185 |
C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials|horses"); |
|
|
186 |
$driver->get( $base_url . "/members/members-home.pl" ); |
186 |
$driver->get( $base_url . "/members/members-home.pl" ); |
187 |
@adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
187 |
@adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
188 |
@filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
188 |
@filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
189 |
- |
|
|