Bug 39745

Summary: Wrong system preference 'language' in test suite
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: Test SuiteAssignee: Fridolin Somers <fridolin.somers>
Status: Failed QA --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: david, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes several tests so that the correct system preference names are used: - language => StaffInterfaceLanguages (name changed in bug 27490) - opaclanguages => OPACLanguages (name now uses the correct case)
Version(s) released in:
Circulation function:
Bug Depends on: 27490    
Bug Blocks: 39720    
Attachments: Bug 39745: Wrong system preference 'language' in test suite
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)

Description Fridolin Somers 2025-04-25 09:05:25 UTC
Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite selenium tests.
Comment 1 Fridolin Somers 2025-04-25 09:09:28 UTC
Created attachment 181494 [details] [review]
Bug 39745: Wrong system preference 'language' in test suite

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite selenium tests.

Also fixes 'opaclanguages' case to 'OPACLanguages'
just to match the file installer/data/mysql/mandatory/sysprefs.sql

Test by running selenium tests onboarding and installation
Comment 2 Fridolin Somers 2025-04-25 09:43:21 UTC
Created attachment 181498 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite selenium tests.

Also fixes 'opaclanguages' case to 'OPACLanguages'
just to match the file installer/data/mysql/mandatory/sysprefs.sql

Test by running selenium tests onboarding and installation
Comment 3 Fridolin Somers 2025-04-25 09:47:37 UTC
Created attachment 181499 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite on mock_preference calls

Test by running impacted tests
Comment 4 David Nind 2025-04-25 18:32:01 UTC
Created attachment 181551 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite selenium tests.

Also fixes 'opaclanguages' case to 'OPACLanguages'
just to match the file installer/data/mysql/mandatory/sysprefs.sql

Test by running selenium tests onboarding and installation

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2025-04-25 18:32:04 UTC
Created attachment 181552 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite on mock_preference calls

Test by running impacted tests

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-04-25 18:39:08 UTC
Testing notes (using KTD):

1. Start up KTD with Selenium: ktd --selenium up
2. Run these test - they should pass before and after the patches:
   prove t/db_dependent/selenium/00-onboarding.t 
   prove t/db_dependent/selenium/01-installation.t
   prove t/db_dependent/Auth.t 
   prove t/db_dependent/Koha/ItemTypes.t 
   prove t/db_dependent/Koha/SharedContent.t
Comment 7 Katrin Fischer 2025-05-06 17:58:45 UTC
I have some confusing problem with selenium, not pushing this yet, leaving for a fresher set of eyes.

Running tests (5)
	* Proving /kohadevbox/koha/t/db_dependent/Koha/SharedContent.t OK!
	* Proving /kohadevbox/koha/t/db_dependent/selenium/01-installation.t KO!

STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
	(eval 397):1 in Selenium::Remote::Driver::__ANON__
	(eval 399):2 in Selenium::Remote::Driver::__ANON__
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
	/kohadevbox/koha/t/lib/Selenium.pm:121 in Selenium::Remote::Driver::find_element
	/kohadevbox/koha/t/db_dependent/selenium/01-installation.t:93 in t::lib::Selenium::fill_form

 Error while executing command: no such element: Unable to locate element: //*[@id="language"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
 at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
 # Looks like your test exited with 255 before it could output anything.
 /kohadevbox/koha/t/db_dependent/selenium/01-installation.t .. 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/2 subtests 
 
Test Summary Report
-------------------
 /kohadevbox/koha/t/db_dependent/selenium/01-installation.t (Wstat: 65280 (exited 255) Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 2 tests but ran 0.
Files=1, Tests=0, 15 wallclock secs ( 0.01 usr  0.00 sys +  0.77 cusr  0.07 csys =  0.85 CPU)
 Result: FAIL

	* Proving /kohadevbox/koha/t/db_dependent/Koha/ItemTypes.t OK!
	* Proving /kohadevbox/koha/t/db_dependent/Auth.t OK!
	* Proving /kohadevbox/koha/t/db_dependent/selenium/00-onboarding.t KO!

STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
	(eval 397):1 in Selenium::Remote::Driver::__ANON__
	(eval 399):2 in Selenium::Remote::Driver::__ANON__
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
	/kohadevbox/koha/t/lib/Selenium.pm:121 in Selenium::Remote::Driver::find_element
	/kohadevbox/koha/t/db_dependent/selenium/00-onboarding.t:92 in t::lib::Selenium::fill_form

 Error while executing command: no such element: Unable to locate element: //*[@id="language"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
 at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
 # Looks like your test exited with 255 before it could output anything.
 /kohadevbox/koha/t/db_dependent/selenium/00-onboarding.t .. 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/2 subtests 

Test Summary Report
-------------------
 /kohadevbox/koha/t/db_dependent/selenium/00-onboarding.t (Wstat: 65280 (exited 255) Tests: 0 Failed: 0)
  Non-zero exit status: 255
   Parse errors: Bad plan.  You planned 2 tests but ran 0.
Files=1, Tests=0, 13 wallclock secs ( 0.01 usr  0.00 sys +  0.77 cusr  0.06 csys =  0.84 CPU)
 Result: FAIL
Comment 8 Martin Renvoize (ashimema) 2025-05-08 16:52:05 UTC
Created attachment 182103 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (selenium)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite selenium tests.

Also fixes 'opaclanguages' case to 'OPACLanguages'
just to match the file installer/data/mysql/mandatory/sysprefs.sql

Test by running selenium tests onboarding and installation

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 9 Martin Renvoize (ashimema) 2025-05-08 16:52:07 UTC
Created attachment 182104 [details] [review]
Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference)

Bug 27490 renamed system preference language to StaffInterfaceLanguages.
Needs to be done in test suite on mock_preference calls

Test by running impacted tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 10 Katrin Fischer 2025-05-09 06:45:36 UTC
Selenium tests don't work for me here, do you have an idea?

 Error while executing command: no such element: Unable to locate element: //*[@id="language"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.