Bug 33263

Summary: selenium/patrons_search.t is failing randomly
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: lucas
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31199
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04
Circulation function:
Bug Depends on: 29971    
Bug Blocks: 25551    
Attachments: Bug 33263: Fix random failure in patrons_search.t

Description Jonathan Druart 2023-03-17 10:56:28 UTC
21:02:22 koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
21:02:22 koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
21:02:22 koha_1       | 	(eval 544):1 in Selenium::Remote::Driver::__ANON__
21:02:22 koha_1       | 	(eval 546):2 in Selenium::Remote::Driver::__ANON__
21:02:22 koha_1       | 	(eval 518):17 in Selenium::Remote::Driver::_execute_command
21:02:22 koha_1       | 	/usr/share/perl5/Selenium/Remote/WebElement.pm:63 in Selenium::Remote::WebElement::_execute_command
21:02:22 koha_1       | 	t/db_dependent/selenium/patrons_search.t:305 in Selenium::Remote::WebElement::click
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
21:02:22 koha_1       | 	t/db_dependent/selenium/patrons_search.t:329 in Test::More::subtest
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
21:02:22 koha_1       | 	/usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
21:02:22 koha_1       | 	t/db_dependent/selenium/patrons_search.t:340 in Test::More::subtest
21:02:22 koha_1       | 
21:02:22 selenium_1   | 1678996938891	Marionette	INFO	Stopped listening on port 46123
21:02:22 selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
21:02:22 selenium_1   | 20:02:19.387 INFO [ActiveSessions$1.onStop] - Removing session 271bae1c-da93-47f1-8ae7-3192cd7be69e (org.openqa.selenium.firefox.GeckoDriverService)
21:02:22 koha_1       |         # Looks like you planned 7 tests but ran 3.
21:02:22 koha_1       | 
21:02:22 koha_1       |     #   Failed test 'remember_search'
21:02:22 koha_1       |     #   at t/db_dependent/selenium/patrons_search.t line 329.
21:02:22 koha_1       |     # Looks like you failed 1 test of 25.
21:02:22 koha_1       | 
21:02:22 koha_1       | #   Failed test 'Search patrons'
21:02:22 koha_1       | #   at t/db_dependent/selenium/patrons_search.t line 340.
21:02:22 koha_1       | Error while executing command: stale element reference: The element reference of <input id="check58" class="selection" name="borrowernumber" type="checkbox"> 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.
21:02:22 koha_1       |  at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
21:02:22 koha_1       | # Looks like your test exited with 255 just after 1.
21:02:22 koha_1       | [20:02:19] t/db_dependent/selenium/patrons_search.t
Comment 1 Jonathan Druart 2023-03-17 10:56:47 UTC
This is different than bug 31199.
Comment 2 Jonathan Druart 2023-03-17 10:58:35 UTC
Created attachment 148324 [details] [review]
Bug 33263: Fix random failure in patrons_search.t

There is a missing wait_for_ajax. After we click "next", we need to make
sure we are using the correct response.
Comment 3 Jonathan Druart 2023-03-17 10:58:53 UTC
Koha_Master/2428
Comment 4 Tomás Cohen Arazi (tcohen) 2023-03-17 13:00:21 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Matt Blenkinsop 2023-03-17 17:21:14 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 6 Lucas Gass (lukeg) 2023-04-21 16:49:35 UTC
Doesn't apply clean to 22.05.x, needs rebase