Bugzilla – Attachment 174685 Details for
Bug 36454
Provide indication if a patron is expired or restricted on patron search autocomplete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36454: (QA follow-up): Selenium - Add regression tests
Bug-36454-QA-follow-up-Selenium---Add-regression-t.patch (text/plain), 3.97 KB, created by
Jonathan Druart
on 2024-11-18 13:17:13 UTC
(
hide
)
Description:
Bug 36454: (QA follow-up): Selenium - Add regression tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-18 13:17:13 UTC
Size:
3.97 KB
patch
obsolete
>From 9c27e4b9cef8eca0c1f402ce8f44fe72664b3cf5 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 18 Nov 2024 12:23:06 +0000 >Subject: [PATCH] Bug 36454: (QA follow-up): Selenium - Add regression tests > >Test plan: >1) $ ktd --selenium up >2) prove t/db_dependent/selenium/patrons_search_badges.t > >Ensure these tests pass before and after the previous 'Use native is_expired instead of redundant JS calculation' patch. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/selenium/patrons_search.t | 79 +++++++++++++++++++++++- > 1 file changed, 78 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index 06a48223037..5f4078e229e 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -145,6 +145,20 @@ sub setup { > ); > unshift @cleanup, $patron_27; > >+ my $patron_28 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ surname => "expired_patron_surname", >+ firstname => 'expired_patron', >+ categorycode => $patron_category->categorycode, >+ branchcode => $library_2->branchcode, >+ dateexpiry => '2000-12-01', >+ } >+ } >+ ); >+ unshift @cleanup, $patron_28; >+ > $attribute_type = Koha::Patron::Attribute::Type->new( > { > code => 'my code1', >@@ -207,7 +221,7 @@ sub teardown { > } > > subtest 'Search patrons' => sub { >- plan tests => 28; >+ plan tests => 29; > > setup(); > my $total_number_of_patrons = Koha::Patrons->search->count; >@@ -463,6 +477,69 @@ subtest 'Search patrons' => sub { > > }; > >+ subtest 'expired and restricted badges' => sub { >+ plan tests => 5; >+ >+ my $patron_28 = Koha::Patrons->search( { surname => 'expired_patron_surname' } )->next; >+ >+ $driver->get( $base_url . "/members/members-home.pl" ); >+ $s->fill_form( { 'searchmember' => 'expired_patron' } ); >+ >+ sleep $DT_delay && $s->wait_for_ajax; >+ >+ like( >+ $driver->find_element('//ul[@id="ui-id-2"]/li/a')->get_text, >+ qr[\Qexpired_patron_surname\E], >+ 'expired_patron is shown' >+ ); >+ >+ is( >+ $driver->find_element('//ul[@id="ui-id-2"]/li/a/span[@class="badge text-bg-warning"]')->get_text, >+ 'Expired', >+ 'Expired badge is shown' >+ ); >+ >+ $patron_28->dateexpiry('2999-12-01')->store; >+ >+ $driver->get( $base_url . "/members/members-home.pl" ); >+ $s->fill_form( { 'searchmember' => 'expired_patron' } ); >+ >+ sleep $DT_delay && $s->wait_for_ajax; >+ >+ my @expired_badges = $driver->find_elements('//ul[@id="ui-id-2"]/li/a/span[@class="badge text-bg-warning"]'); >+ is( >+ scalar @expired_badges, 0, >+ 'No expired badge is shown' >+ ); >+ >+ $patron_28->debarred('2048-11-18')->store; >+ >+ $driver->get( $base_url . "/members/members-home.pl" ); >+ $s->fill_form( { 'searchmember' => 'expired_patron' } ); >+ >+ sleep $DT_delay && $s->wait_for_ajax; >+ >+ my @restricted_badges = $driver->find_elements('//ul[@id="ui-id-2"]/li/a/span[@class="badge text-bg-danger"]'); >+ is( >+ $driver->find_element('//ul[@id="ui-id-2"]/li/a/span[@class="badge text-bg-danger"]')->get_text, >+ 'Restricted', >+ 'Restricted badge is shown' >+ ); >+ >+ $patron_28->dateexpiry('2000-12-01')->store; >+ >+ $driver->get( $base_url . "/members/members-home.pl" ); >+ $s->fill_form( { 'searchmember' => 'expired_patron' } ); >+ >+ sleep $DT_delay && $s->wait_for_ajax; >+ >+ is( >+ $driver->find_element('//ul[@id="ui-id-2"]/li/a/span[@class="badge text-bg-warning"]')->get_text, >+ 'Expired', >+ 'Both badges are shown' >+ ); >+ }; >+ > teardown(); > > }; >-- >2.34.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 36454
:
171516
|
171630
|
171631
|
171632
|
171633
|
171839
|
171840
|
174671
|
174682
|
174684
| 174685 |
174686
|
174687