Lines 170-188
subtest 'Search patrons' => sub {
Link Here
|
170 |
$driver->get( $base_url . "/members/members-home.pl" ); |
170 |
$driver->get( $base_url . "/members/members-home.pl" ); |
171 |
my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
171 |
my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
172 |
is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.'); |
172 |
is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.'); |
173 |
is( $adv_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set'); |
173 |
is( $adv_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set'); |
174 |
my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
174 |
my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
175 |
is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set'); |
175 |
is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set'); |
176 |
is( $filter_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set'); |
176 |
is( $filter_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set'); |
177 |
C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials"); |
177 |
C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials"); |
178 |
$driver->get( $base_url . "/members/members-home.pl" ); |
178 |
$driver->get( $base_url . "/members/members-home.pl" ); |
179 |
@adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
179 |
@adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); |
180 |
is( scalar @adv_options, $nb_standard_fields, 'New option added when DefaultPatronSearchFields is populated with a field. Note that middle_name disappears, we do not want it if not part of DefaultPatronSearchFields'); |
180 |
is( scalar @adv_options, $nb_standard_fields, 'New option added when DefaultPatronSearchFields is populated with a field. Note that middle_name disappears, we do not want it if not part of DefaultPatronSearchFields'); |
181 |
is( $adv_options[0]->get_value(), 'firstname,initials', 'Standard search uses DefaultPatronSearchFields when populated'); |
181 |
is( $adv_options[0]->get_value(), 'firstname|initials', 'Standard search uses DefaultPatronSearchFields when populated'); |
182 |
@filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); |
182 |
@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'); |
183 |
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(), 'firstname,initials', 'Standard filter uses DefaultPatronSearchFields when populated'); |
184 |
is( $filter_options[0]->get_value(), 'firstname|initials', 'Standard filter uses DefaultPatronSearchFields when populated'); |
185 |
C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials,horses"); |
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 |
- |
|
|