Koha-clms/t
Martin Renvoize 106fabbf9a
Bug 43669: Make t::lib::Selenium wait for the server to be ready
This patch adds a wait_for_server_ready check to t::lib::Selenium, so
Selenium-based tests poll the server until it responds successfully
before driving it, instead of assuming it is already up.

This guards against a race we saw on Jenkins CI:
t/db_dependent/selenium/00-onboarding.t and
t/db_dependent/selenium/01-installation.t both failed with 'no such
element: //div[@class="alert alert-success"]' right after the DB
connection check step, immediately after run_tests.pl's
get_commands_to_reset_db() restarted Apache/Plack. That helper
restarts services and moves straight to running the tests with no
readiness wait, so the very first requests can hit workers that are
still warming up. The test then fails on a missing page element even
though there is no bug in the installer flow itself.

A companion issue has been filed against koha-misc4dev to add a
readiness wait to run_tests.pl itself:
https://gitlab.com/koha-community/koha-misc4dev/-/work_items/108

Test plan:
1. Apply the patch
2. Run t/db_dependent/selenium/01-installation.t (or 00-onboarding.t)
   against a fresh empty database with KOHA_TESTING=1, as usual
3. Confirm it still passes normally
4. To exercise the new wait: drop/recreate the database, then run
   "sudo service apache2 restart" and "sudo service koha-common
   restart", then immediately run the selenium test with no delay.
   Confirm it either passes (server came up in time) or fails fast
   with a clear "Cannot wait more for the server to be ready" message
   rather than a confusing missing-element error deep in the install
   wizard

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-29 16:03:56 +00:00
..
Acquisition
…
Biblio
…
Budgets
…
C4/ClassSplitRoutine Bug 30233: (follow-up) Add tests for _apply_substitution and combined modifiers 2026-08-11 12:39:30 +00:00
External Bug 41479: Remove Baker & Taylor integration 2026-03-24 07:50:10 +01:00
Koha Bug 10190: (QA follow-up): fixes phase six 2026-09-21 16:07:44 +00:00
Number
…
SIP
…
Search Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Serials Bug 41330: Unit tests 2026-03-09 17:06:49 -06:00
Template Bug 42136: Add tests 2026-04-28 15:48:21 -06:00
Test Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
cypress Bug 42697: Add Cypress tests 2026-09-25 12:08:40 +00:00
data Bug 41032: Fix Open Fifth missing in plugin repos config 2025-11-26 10:40:25 -07:00
db_dependent Bug 42490: (QA follow-up) Reword syspref description and options 2026-09-28 15:29:59 +00:00
edi_testfiles Bug 30144: Add tests for EDIFACT servicing instruction handling 2026-08-28 16:36:24 +00:00
etc
…
lib Bug 43669: Make t::lib::Selenium wait for the server to be ready 2026-09-29 16:03:56 +00:00
mock_templates Bug 42684: Capitalization: No Barcode 2026-06-12 16:24:07 +00:00
00-check-atomic-updates.t
…
00-load.t Bug 42714: RM follow-up: Fix tests 2026-08-13 11:28:40 +00:00
00-merge-conflict-markers.t
…
00-testcritic.t
…
00-valid-systemd-units.t Bug 40901: (QA follow-up) Document the two init packages, the new options and the logging change 2026-09-29 09:02:38 +00:00
00-valid-xml.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Auth.t
…
AuthoritiesMarc_MARC21.t Bug 41795: Fix failing test in UNIMARC instances 2026-05-01 11:04:33 -06:00
AuthoritiesMarc_UNIMARC.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t
…
Biblio2.t
…
Breeding.t Bug 40017: (follow-up) Update GNU license link 2025-10-22 07:42:53 -06:00
Budgets.t
…
Charset.t
…
Circulation_barcodedecode.t
…
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
ClassSortRoutine_Generic.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
ClassSortRoutine_LCC.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
ClassSource.t
…
Context.t Bug 39337: Add is_opac_suppressed helper to C4::Context 2026-08-25 08:56:25 +00:00
Contract.t
…
CookieManager.t
…
Creators.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
DateUtils.t
…
EdiInvoice.t
…
Edifact.t Bug 40383: Add unit tests for Koha::Edifact to_json method 2026-03-26 14:21:18 +01:00
Ediorder.t Bug 30144: (QA follow-up) Fix t/Ediorder.t for JSON servicing_instruction format 2026-09-09 12:07:21 +00:00
Ediordrsp.t
…
Form_MessagingPreferences.t Bug 43117: Restore use Test::NoWarnings 2026-09-01 15:42:02 +00:00
HtmlTags.t
…
ImportBatch.t
…
Installer_PerlModules.t
…
ItemCirculationAlertPreference.t
…
Koha_MetadataRecord.t
…
Koha_SearchEngine_Elasticsearch_Browse.t
…
Koha_Template_Plugin_HtmlId.t
…
Koha_Template_Plugin_Koha.t Bug 41107: (follow-up) Use Koha::Status in Koha::Template::Plugin::Koha 2026-03-23 09:33:54 +01:00
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Koha_XSLT_HTTPS.t
…
Labels.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Labels_split_Regex.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Labels_split_ccn.t
…
Labels_split_ddcn.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Labels_split_lccn.t Bug 40680: Fix t/Labels* 2025-12-01 08:34:00 -07:00
Languages.t Bug 39745: Replace more occurrences in selenium tests 2026-02-09 12:57:59 -07:00
Logger.t
…
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t Bug 30261: Update unit tests 2026-03-20 11:54:32 +00:00
Output_JSONStream.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
RecordProcessor.t
…
Ris.t
…
SMS.t Bug 40680: Fix t tests 2025-12-01 08:34:01 -07:00
Scheduler.t
…
Scrubber.t Bug 40659: Change Scrubber profile name to opac_virtual_card 2026-04-23 16:04:11 -06:00
Search.t
…
Search_PazPar2.t
…
SimpleMARC.t Bug 28915: Add control field support to Koha::SimpleMARC::update_field() 2026-06-15 15:24:05 +00:00
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t
…
TmplToken.t
…
Token.t
…
template_filters.t
…
timezones.t
…