From e1fe0bbf57842b67e57ce243d3b86d2685454754 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 21 Jul 2026 14:40:16 +0000 Subject: [PATCH] Bug 41604: (follow-up) Wait for the page to be ready before searching in patrons_search.t Bug 41604 made every page do a bit more work when it loads. This Selenium test didn't wait for that work to finish before typing into the search box, so sometimes it searched too early and got the wrong results. This adds a short wait after each page load so the test only searches once the page is actually ready. Introduced by: Bug 41604: Save user decision per column when visibility changes Test plan: prove t/db_dependent/selenium/patrons_search.t Co-Authored-By: Claude Sonnet 5 Signed-off-by: Lucas Gass --- t/db_dependent/selenium/patrons_search.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t index 76f85d5b0f..9fa10069b5 100755 --- a/t/db_dependent/selenium/patrons_search.t +++ b/t/db_dependent/selenium/patrons_search.t @@ -283,6 +283,7 @@ subtest 'Search patrons' => sub { # 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" ); + sleep $DT_delay && $s->wait_for_ajax; $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form; my $first_patron = Koha::Patrons->search( { surname => { like => 'test_patron_%' } } )->next; @@ -325,6 +326,7 @@ subtest 'Search patrons' => sub { ); $driver->get( $base_url . "/members/members-home.pl" ); + sleep $DT_delay && $s->wait_for_ajax; $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form; sleep $DT_delay && $s->wait_for_ajax; @@ -465,6 +467,7 @@ subtest 'Search patrons' => sub { $patron_category->replace_library_limits( [ $library->id ] ); C4::Context->set_preference( 'PatronsPerPage', 5 ); $driver->get( $base_url . "/members/members-home.pl" ); + sleep $DT_delay && $s->wait_for_ajax; clear_filters(); $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form; @@ -486,6 +489,7 @@ subtest 'Search patrons' => sub { C4::Context->set_preference( 'PatronsPerPage', 5 ); $driver->get( $base_url . "/members/members-home.pl" ); + sleep $DT_delay && $s->wait_for_ajax; clear_filters(); $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form; @@ -511,6 +515,7 @@ subtest 'Search patrons' => sub { # Perform another search $driver->get( $base_url . "/members/members-home.pl" ); + sleep $DT_delay && $s->wait_for_ajax; clear_filters(); $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form; @@ -547,6 +552,7 @@ subtest 'Search patrons' => sub { # We have a patron with date of birth=1980-06-17 => formatted as 17/06/1980 $driver->get( $base_url . "/members/members-home.pl" ); + sleep $DT_delay && $s->wait_for_ajax; clear_filters(); $s->fill_form( { 'search_patron_filter' => 'test_patron' } ); $s->submit_form;