From 7bcda4665437f8dcbc952f8bd3d00f88184bc74b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 11 Mar 2024 16:41:12 +0100 Subject: [PATCH] Bug 32671: Prevent selenium/basic_workflow.t to fail if run on slow servers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When submitting the form to create a new patron we are doing a POST memberentry.pl that is redirecting to moremember.pl The selenium test is expecting for the end of the request to test the page's title against "Patron details for ". But it's only waiting for the POST response (302), not the GET moremember that will display the patron's details. You can simulate a slow server using cpulimit: `cpulimit -b -p $PID -l 1` replacing $PID with the pid of the starman process. Note that other tests are failing using 1%, but... baby steps. The current failre: # Failed test at t/db_dependent/selenium/basic_workflow.t line 122 Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125 # 'Add patron (test cat description) › Patrons › Koha' # doesn't match '(?^u:Patron details for test_patron_surname)' The next one (NOT fixed by this patch): # Failed test at t/db_dependent/selenium/basic_workflow.t line 256. # ' # # Checkouts (0)# # '# doesn't match '(?^u:Checkouts \(1\))' t/db_dependent/selenium/basic_workflow.t .. 14/22 # Failed test at t/db_dependent/selenium/basic_workflow.t line 256. # ' # # Checkouts (1) # # ' # doesn't match '(?^u:Checkouts \(2\))' t/db_dependent/selenium/basic_workflow.t .. 16/22 # Failed test at t/db_dependent/selenium/basic_workflow.t line 256. # ' # # Checkouts (2) # # ' # doesn't match '(?^u:Checkouts \(3\))' Signed-off-by: Katrin Fischer (cherry picked from commit 4e166e07c15a5726319e20bfef21dc543f0b58a4) Signed-off-by: Fridolin Somers (cherry picked from commit 5d73ff2da11a3e8b3e40be637c1d5750c56a7e04) Signed-off-by: Lucas Gass --- t/db_dependent/selenium/basic_workflow.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t index d8a181d15a..e430a57ad6 100755 --- a/t/db_dependent/selenium/basic_workflow.t +++ b/t/db_dependent/selenium/basic_workflow.t @@ -119,6 +119,8 @@ SKIP: { like( $driver->get_title(), qr(Add .*$sample_data->{category}{description}), ); $s->fill_form( $sample_data->{patron} ); $driver->find_element('//button[@id="saverecord"]')->click; + my $borrowernumber = Koha::Patrons->_resultset->get_column('borrowernumber')->max; + $driver->get($base_url.'/members/moremember.pl?borrowernumber='.$borrowernumber); like( $driver->get_title(), qr(Patron details for $sample_data->{patron}{surname}), ); ####$driver->get($base_url.'/members/members-home.pl'); -- 2.39.5