Bugzilla – Attachment 137612 Details for
Bug 21978
Add middle name field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21978: Fix Selenium tests
Bug-21978-Fix-Selenium-tests.patch (text/plain), 5.26 KB, created by
Jonathan Druart
on 2022-07-12 08:43:05 UTC
(
hide
)
Description:
Bug 21978: Fix Selenium tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-12 08:43:05 UTC
Size:
5.26 KB
patch
obsolete
>From b18d1fe2b90561ae9ab0fc579af99d9604424b17 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Jul 2022 10:42:39 +0200 >Subject: [PATCH] Bug 21978: Fix Selenium tests > >--- > t/db_dependent/selenium/patrons_search.t | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index cd635991929..5c086b00aba 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -155,28 +155,29 @@ subtest 'Search patrons' => sub { > $s->auth; > C4::Context->set_preference('DefaultPatronSearchFields',""); > my $PatronsPerPage = 15; >+ my $nb_standard_fields = 13; > C4::Context->set_preference('PatronsPerPage', $PatronsPerPage); > $driver->get( $base_url . "/members/members-home.pl" ); > my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); >- is( scalar @adv_options, 13, 'All standard fields are searchable if DefaultPatronSearchFields not set'); >- is( $adv_options[0]->get_value(), 'firstname,surname,othernames,cardnumber,userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set'); >+ is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.'); >+ is( $adv_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set'); > my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); >- is( scalar @filter_options, 13, 'All standard fields are searchable by filter if DefaultPatronSearchFields not set'); >- is( $filter_options[0]->get_value(), 'firstname,surname,othernames,cardnumber,userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set'); >+ is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set'); >+ is( $filter_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set'); > C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials"); > $driver->get( $base_url . "/members/members-home.pl" ); > @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); >- is( scalar @adv_options, 13, 'New option added when DefaultPatronSearchFields is populated with a field'); >+ 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'); > is( $adv_options[0]->get_value(), 'firstname,initials', 'Standard search uses DefaultPatronSearchFields when populated'); > @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); >- is( scalar @filter_options, 13, 'New filter option added when DefaultPatronSearchFields is populated with a field'); >+ is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field'); > is( $filter_options[0]->get_value(), 'firstname,initials', 'Standard filter uses DefaultPatronSearchFields when populated'); > C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials,horses"); > $driver->get( $base_url . "/members/members-home.pl" ); > @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); > @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); >- is( scalar @adv_options, 13, 'Invalid option not added when DefaultPatronSearchFields is populated with an invalid field'); >- is( scalar @filter_options, 13, 'Invalid filter option not added when DefaultPatronSearchFields is populated with an invalid field'); >+ is( scalar @adv_options, $nb_standard_fields, 'Invalid option not added when DefaultPatronSearchFields is populated with an invalid field'); >+ is( scalar @filter_options, $nb_standard_fields, 'Invalid filter option not added when DefaultPatronSearchFields is populated with an invalid field'); > # NOTE: We should probably ensure the bad field is removed from 'standard' search here, else searches are broken > C4::Context->set_preference('DefaultPatronSearchFields',""); > $driver->get( $base_url . "/members/members-home.pl" ); >@@ -209,8 +210,8 @@ subtest 'Search patrons' => sub { > is( > $driver->get_title, > sprintf( >- "Modify patron %s %s (%s) %s (%s) (%s) ⺠Patrons ⺠Koha", >- $first_patron->title, $first_patron->firstname, $first_patron->othernames, $first_patron->surname, $first_patron->cardnumber, >+ "Modify patron %s %s %s (%s) %s (%s) (%s) ⺠Patrons ⺠Koha", >+ $first_patron->title, $first_patron->firstname, $first_patron->middle_name, $first_patron->othernames, $first_patron->surname, $first_patron->cardnumber, > $first_patron->category->description, > ), > 'Page title is correct after following modification link' >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21978
:
133431
|
133432
|
133433
|
133434
|
133435
|
133436
|
133437
|
133438
|
133453
|
133454
|
133455
|
133456
|
133534
|
133535
|
133536
|
133537
|
133544
|
133545
|
133546
|
133547
|
133751
|
133752
|
133753
|
133754
|
133755
|
133756
|
133757
|
134254
|
134255
|
134256
|
134257
|
134258
|
134259
|
134495
|
134497
|
134498
|
134499
|
134500
|
134501
|
134502
|
134503
|
134745
|
134746
|
134747
|
134748
|
134749
|
134750
|
134751
|
135147
|
135148
|
135149
|
135150
|
135151
|
135152
|
135153
|
135154
|
135155
|
135180
|
135181
|
135182
|
135183
|
135184
|
135185
|
135186
|
135187
|
135188
|
135189
|
136513
|
136514
|
136515
|
136516
|
136517
|
136518
|
136519
|
136520
|
136521
|
136522
| 137612