Bugzilla – Attachment 174472 Details for
Bug 28633
Add a preferred name field to patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28633: Fix patrons_search.t
Bug-28633-Fix-patronssearcht.patch (text/plain), 4.81 KB, created by
Jonathan Druart
on 2024-11-13 14:49:43 UTC
(
hide
)
Description:
Bug 28633: Fix patrons_search.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-13 14:49:43 UTC
Size:
4.81 KB
patch
obsolete
>From 4c51e89f9a72427d9b8426109f1a38e23bd652ee Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Nov 2024 15:45:56 +0100 >Subject: [PATCH] Bug 28633: Fix patrons_search.t > >This does not belong here, but raised to me here, so attaching on this >one. >This feels like it's coming from bug 33484, but those tests were passing >after it has been pushed. > >This patch fixes the following error: >Error while executing command: stale element reference: The element reference of <input type="text"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed at /usr/share/perl5/Selenium/Remote/Driver.pm line 411. > >Since bug 33484 the row with the filters is redrawn on table redraw. So >we need to search for the input every time the table is redrawn. >--- > t/db_dependent/selenium/patrons_search.t | 37 ++++++++++++------------ > 1 file changed, 19 insertions(+), 18 deletions(-) > >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index 069c4983dac..aa6f74c6112 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -411,6 +411,10 @@ subtest 'Search patrons' => sub { > > C4::Context->set_preference( 'dateformat', 'metric' ); > >+ sub get_dob_search_filter { >+ return $s->driver->find_element( '//table[@id="' . shift . '"]//th[@aria-label="Date of birth: activate to sort column ascending"]/input' ); >+ } >+ > # We have a patron with date of birth=1980-06-17 => formatted as 17/06/1980 > > $driver->get( $base_url . "/members/members-home.pl" ); >@@ -420,46 +424,43 @@ subtest 'Search patrons' => sub { > sleep $DT_delay && $s->wait_for_ajax; > > $s->show_all_entries( '//div[@id="' . $table_id . '_wrapper"]' ); >- my $dob_search_filter = >- $s->driver->find_element( '//table[@id="' . $table_id . '"]//input[@placeholder="Date of birth search"]' ); > >- $dob_search_filter->send_keys('1980'); >+ get_dob_search_filter($table_id)->send_keys('1980'); > sleep $DT_delay && $s->wait_for_ajax; > my $patron_27 = Koha::Patrons->search( { surname => 'test_patron_27' } )->next; > is( is_patron_shown($patron_27), 1, 'search by correct year shows the patron' ); >- $dob_search_filter->clear; >- $dob_search_filter = $s->driver->find_element( '//table[@id="' . $table_id . '"]//input[@placeholder="Date of birth search"]' ); >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('1986'); >+ get_dob_search_filter($table_id)->send_keys('1986'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 0, 'search by incorrect year does not show the patron' ); >- $dob_search_filter->clear; >- $dob_search_filter = $s->driver->find_element( '//table[@id="' . $table_id . '"]//input[@placeholder="Date of birth search"]' ); >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('1980-06'); >+ get_dob_search_filter($table_id)->send_keys('1980-06'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 1, 'search by correct year-month shows the patron' ); >- $dob_search_filter->clear; >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('1980-06-17'); >+ get_dob_search_filter($table_id)->send_keys('1980-06-17'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 1, 'search by correct full iso date shows the patron' ); >- $dob_search_filter->clear; >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('1986-06-17'); >+ get_dob_search_filter($table_id)->send_keys('1986-06-17'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 0, 'search by incorrect full iso date does not show the patron' ); >- $dob_search_filter->clear; >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('17/06/1980'); >+ get_dob_search_filter($table_id)->send_keys('17/06/1980'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 1, 'search by correct full formatted date shows the patron' ); >- $dob_search_filter->clear; >+ get_dob_search_filter($table_id)->clear; > >- $dob_search_filter->send_keys('17/06/1986'); >+ get_dob_search_filter($table_id)->send_keys('17/06/1986'); > sleep $DT_delay && $s->wait_for_ajax; > is( is_patron_shown($patron_27), 0, 'search by incorrect full formatted date does not show the patron' ); >- $dob_search_filter->clear; >+ get_dob_search_filter($table_id)->clear; >+ > }; > > 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 28633
:
123008
|
123009
|
123010
|
123658
|
125497
|
125498
|
125499
|
125500
|
126591
|
128968
|
128969
|
128970
|
130000
|
130001
|
130002
|
133445
|
133446
|
133447
|
133448
|
133449
|
133450
|
133451
|
133958
|
133959
|
133960
|
133961
|
133962
|
133963
|
133964
|
133965
|
166792
|
166793
|
166794
|
166813
|
166814
|
166815
|
166816
|
166817
|
167163
|
167164
|
173628
|
173629
|
173630
|
173631
|
173632
|
173633
|
173634
|
173664
|
173665
|
173666
|
173667
|
173668
|
173669
|
173670
|
173717
|
173718
|
173719
|
173813
|
173814
|
173815
|
173816
|
173826
|
173827
|
173828
|
173829
|
173930
|
173931
|
173932
|
173933
|
173934
|
173935
|
173936
|
174419
|
174420
| 174472 |
175177