Commit Graph

247 Commits

Author SHA1 Message Date
Owen Leonard 899e4001e8
Bug 24949: Provide password visibility toggle / icon to unmask password on staff login screen
This patch adapts the work on Bug 34778 to the staff client, adding a
"Show password" checkbox to the login form.

To test, apply the batch and go to the staff client login screen.

- You should see a "Show password" checkbox under the password field.
- Type something in the password field. It should be masked (****).
- Click the "Show password" label or check the checkbox.
- The password field should now show the text you entered.
- Confirm that you can log in successfully whether or not the password
  is visible.
- `prove t/db_dependent/selenium/authentication.t` should pass.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Mikko <mikko.liimatainen@turku.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-27 11:38:42 -07:00
Jonathan Druart 458a163360
Bug 39745: Replace more occurrences in selenium tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-09 12:57:59 -07:00
Jonathan Druart 849f67988f
Bug 41076: Adjust our perl tidiness for v20250105
Generated using
  `perl misc/devel/tidy.pl --perl`

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-05 09:03:51 -07:00
David Nind ef2f7524c0
Bug 41494: Rename "Koha administration" module name to "Administration"
This changes "Koha administration" to "Administration" on the
staff interface home page and the administration module home page.

Everywhere else in the staff interface, such as browser page titles
and breadcrumbs, administration is used.

This improves consistency, and is how it is commonly referred to.

It also change some other occurences in the code base, such
as code comments.

Test plan:
1. Note the inconsistencies in how we name and refer to the
   administration module:
   1.1 Staff interface home page: Koha administration
   1.2 Administration module home page: Koha administration, but note
       that the breadcrumb and browser page title is "Administration".
   1.3 Breadcrumbs and browser page titles for any of the administration
       areas are just "Administration".
   1.4 More > Administration.
2. Apply the patch.
3. Note that on the staff interface home page and the administration
   home page are now labelled "Administration".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:37 -07:00
Owen Leonard 37c1d61207
Bug 26258: (follow-up) Fix t/db_dependent/selenium/basic_workflow.t
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-03 14:20:48 -07:00
Jonathan Druart f4d8525806
Bug 38311: Fix Selenium and Cypress tests
.dt-select-filter does no longer exist

Here we rely on DT's API to retrieve the correct visible column index.
However we cannot for Selenium tests, not ideal but it fixes the
failure.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-02 10:07:20 -07:00
Tomás Cohen Arazi 4c98193075
Bug 41038: Add tests for superlibrarian managing other users' 2FA
Adds comprehensive selenium tests for the new functionality where
superlibrarians can manage 2FA settings for other patrons.

To test:
1. Run the existing authentication_2fa.t selenium tests
2. Notice missing coverage for cross-user 2FA management
3. Apply the patch
4. Run the tests again
5. Verify new subtests pass:
   - Superlibrarian can view/disable other users' 2FA
   - Enable button is hidden with explanatory message
   - Non-superlibrarian gets 403 error for other users

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:51 -07:00
Jonathan Druart 096fd56b6c
Bug 30724: Fix selenium tests - info => success class
I don't think this is correct. We only want success after we enabled 2FA

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-16 15:20:17 -06:00
Jonathan Druart e77d2ad22b
Bug 30724: Fix selenium tests - wording
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-16 15:20:17 -06:00
Tomás Cohen Arazi 6b478e0da9
Bug 40163: (follow-up) Fix wrong GNU links and update test
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-24 09:25:04 -06:00
Jonathan Druart 0de9601048
Bug 36095: Fix Selenium tests
#                   'Details for opac holds test place hold button › Koha online catalog'
        #     doesn't match '(?^u:Details for: opac holds test place hold button)'

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 11:04:53 -06:00
Jonathan Druart c456dd86b4
Bug 40444: Fix onboarding and installer selenium tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-28 16:26:38 -06:00
Jonathan Druart 63eb2e1f4a
Bug 40444: Add a test to ensure all Perl test files use Test::NoWarnings
This patch adds a new xt test (xt/use-test-no-warnings.t) to make sure
all our Perl test files will use Test::NoWarnings.

It also adds Test::NoWarnings to some files that were missing it and
that didn't need any other changes.

However we still have 7 non-trivial tests that we will consider
exception for now, until they are fixed.

Test plan:
  prove xt/use-test-no-warnings.t
should return green.
And all other tests modified by this patch (the qa script will do that
for you)

You can also test the 2 selenium tests:
1. DROP and CREATE the DB
  DROP DATABASE koha_kohadev;
  CREATE DATABASE koha_kohadev;
  restart_all
2. KOHA_TESTING=1 prove t/db_dependent/selenium/00-onboarding.t
3. Repeat 1
2. KOHA_TESTING=1 prove t/db_dependent/selenium/01-installation.t

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-28 16:26:36 -06:00
Jonathan Druart 0e12c572e8
Bug 40406: Remove warnings from selenium/basic_workflow.t
t/db_dependent/selenium/basic_workflow.t .. 1/22 CP main = 1.93
t/db_dependent/selenium/basic_workflow.t .. 3/22 CP add patron category = 3.56
t/db_dependent/selenium/basic_workflow.t .. 5/22 CP add patron = 4.31
CP add biblio = 0.29
t/db_dependent/selenium/basic_workflow.t .. 11/22 CP add items = 9.81
t/db_dependent/selenium/basic_workflow.t .. 16/22 CP checkout = 5.97
t/db_dependent/selenium/basic_workflow.t .. 20/22 CP checkin = 4.04
t/db_dependent/selenium/basic_workflow.t .. 22/22 CP holds = 5.60
t/db_dependent/selenium/basic_workflow.t .. ok

This has been used in the past for benchmarking Koha.

I suggest to keep the warn but comment it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-18 11:10:00 -06:00
Jonathan Druart 5f44a5ef5a
Bug 40316: Remove warnings from selenium/regressions.t
Wide character in print at /usr/share/perl/5.36/Test2/Formatter/TAP.pm line 156.

Test plan:
Confirm that
  % prove t/db_dependent/selenium/regressions.t
still passes and does not generate warnings

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-08 15:42:03 -06:00
Jonathan Druart d538261fd4
Bug 40129: Fix selenium tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-07 10:20:28 -06:00
Martin Renvoize 1941a0c87e
Bug 39011: (follow-up) Update selenium tests
We alter how the options are added to the patrons_search datatables
search bar, but we didn't update the selenium test to match.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-09 16:52:59 +02:00
Martin Renvoize 348ba00ba9
Bug 39237: (follow-up) Fix selenium tests
We change the page title in the templates, but didn't update the
corrseponding selenium test

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-09 16:52:58 +02:00
Jonathan Druart a5f671330e
Bug 39323: Fix selenium/update_child_to_adult.t
This test is not really needed. It the new window opens correctly the
next test will pass.
And should fail if it does not.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-29 17:19:34 +02:00
Jonathan Druart 1d844a7d2f
Bug 39325: Automatic fix
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:22 +02:00
Pedro Amorim d3173a8d7b
Bug 36197: Add tests
0) If k-t-d, run updatedatabase (ignore this if testing on a sandbox)
1) Enable ILLModule syspref:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModule
2) No need to install a backend as 35570 is in the tree
3) On a different browser session, without being lgoged in, access the create ILL request OPAC page directly:
  {opac_url}/cgi-bin/koha/opac-illrequests.pl?method=create&backend=Standard
4) Notice you're presented with the login page, as expected
5) Enable ILLOpacUnauthenticatedRequest:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLOpacUnauthenticatedRequest
6) Repeat step 3) Notice you now get the create ILL request form, with some additional inputs at the top specific to an unauthenticated request (first name, last name, e-mail address)
6.5) (optional) Confirm the 'Make an Interlibrary loan request' link exists at the bottom of the search results page, while unauthenticated on OPAC:
  {opac_url}/cgi-bin/koha/opac-search.pl?idx=&q=music&weight_search=1
  This should only show for authenticated OPAC users if ILLOpacUnauthenticatedRequest is off.
7) Test the form, try submitting with some blank fields, change type and library after and before inputing data in the input fields, etc.
8) Submit the form successfully. Notice you're presented with the unauthenticated request submission confirmation screen with a message and request details.
9) Go back to Staff UI, logged in, access ILL requests and confirm the unauthenticated request submitted through the OPAC is there:
  {staff_url}/cgi-bin/koha/ill/ill-requests.pl
10) Test that you can add a patron afterwards, if needed, by clicking 'Edit request' on the toolbar of the manage request page, and entering a patron ID
11) Test that you're able to 'confirm' the request by clicking 'Confirm request', as if it was a regular 'NEW' request.

Additional testing:
 Make sure existing ILL functionality interacts with this new optional workflow behavior.
 For this, we're using ILLModuleDisclaimerByType. ILLCheckAvailability or AutoILLBackendPriority can also be used but require more setup (plugins, credentials, etc)
1) Configure ILLModuleDisclaimerByType, visit
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModuleDisclaimerByType
2) Click the 'edit' link at the bottom of the syspref and copy the example code from the description into the text box. Save.
3) Repeat the original test plan from above, but make sure the request type is not 'article' (as that type is bypassed). Use 'journal', for example. Submit the request making sure you fill in all mandatory fields.
4) Notice you're now presented with the ILL request disclaimer screen, hit Submit. Notice the request is created as before.
5) Return to Staff UI, logged in, confirm this 2nd unauthenticated request has been created and the type disclaimer info is stored and presented when viewing the request.

Run tests (k-t-d only):
  prove t/db_dependent/Koha/ILL/Request/Config.t
  prove t/db_dependent/selenium/opac_ill_requests.t

Sponsored-by: NHS England (National Health Service England)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:06 +02:00
Jonathan Druart d633edf449
Bug 38944: Revert changes to selenium/01-installation.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-13 17:25:05 +01:00
Jonathan Druart 3839794d31
Bug 38944: Correctly catch warnings raised by DBI
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-13 17:25:05 +01:00
Jonathan Druart df76c8a9e7
Bug 38944: Manual changes
Not caught by the script

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-13 17:25:04 +01:00
Jonathan Druart 5b69e6df98
Bug 38944: Add Test::NoWarnings to tests no producing warnings
This has been generated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-13 17:25:03 +01:00
Jonathan Druart c73e0b30bd
Bug 28453: Adjust OPAC pagination
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-10 11:42:39 +01:00
Koha Development Team d659526b5a
Bug 38664: Tidy the whole codebase
This commit is generated using:
  % perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:24 +01:00
Jonathan Druart 86a8c1d233
Bug 34778: (follow-up) Remove the include file
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-03 14:27:02 +01:00
Lucas Gass 0e2222f9af
Bug 34778: Add a selenium test
prove -v t/db_dependent/selenium/authentication.t

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-03 14:27:00 +01:00
Katrin Fischer 93e5fdc744
Revert "Bug 36025: Selenium test for the query parameters"
This reverts commit 889455bccb.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:54 +01:00
Katrin Fischer e1a8dc875f
Revert "Bug 36025: Selenium test for the query parameters"
This reverts commit 395e2bd784.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:53 +01:00
Lucas Gass 2350a2ada8
Bug 37398: Fix test in basic_workflow.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-02 11:11:21 +01:00
Andreas Jonsson 395e2bd784
Bug 36025: Selenium test for the query parameters
Fix selenium test:

1. Use classname of form instead of no longer existing id
2. Fix test count

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:47 +01:00
Andreas Jonsson 889455bccb
Bug 36025: Selenium test for the query parameters
The test verifies that there is no clause for extended
attributes in the patron search query when no patron
attribute is searchable by default.

NC amended patch - tidied

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:46 +01:00
Katrin Fischer 9cd189ad16
Bug 38444: Fix unit test count
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-22 10:22:36 +01:00
David Cook 2683b8332b
Bug 38444: (QA follow-up) tidy
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-22 10:22:36 +01:00
Nick Clemens c79358235b
Bug 38444: Unit test to ensure limited categories don't break display
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-22 10:22:35 +01:00
Jonathan Druart eebc357ac5
Bug 36454: Selenium - test patrons must start with 'test_'
I usually
 > delete from borrowers where surname like "test_"
So I do not need to reset_all

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:04:27 +01:00
Pedro Amorim 7882a2fc0e
Bug 36454: (QA follow-up): Selenium - Add regression tests
Test plan:
1) $ ktd --selenium up
2) prove t/db_dependent/selenium/patrons_search_badges.t

Ensure these tests pass before and after the previous 'Use native is_expired instead of redundant JS calculation' patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:04:25 +01:00
Jonathan Druart 51a38670d5
Bug 36640: Fix selenium/patrons_search.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:37 +01:00
Jonathan Druart 1577934808
Bug 36640: Fix selenium tests
Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:27 +01:00
Jonathan Druart 1a9dfde667
Bug 28633: Fix patrons_search.t
This does not belong here, but raised to me here, so attaching on this
one.
This feels like it's coming from bug 33484, but those tests were passing
after it has been pushed.

This patch fixes the following error:
Error while executing command: stale element reference: The element reference of <input type="text"> 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.

Since bug 33484 the row with the filters is redrawn on table redraw. So
we need to search for the input every time the table is redrawn.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-13 17:00:48 +01:00
Nick Clemens d7fa540195
Bug 28633: (follow-up) Set preferred name and adjust counts for tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-12 17:50:14 +01:00
Katrin Fischer 3fe11299f4
Bug 33484: (QA follow-up) Fix patrons_search.t selenium test
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-10-28 17:10:34 +01:00
Jonathan Druart 382ae250bf
Bug 33484: Fix selenium/patrons_search.t
Filters are saved, we need to clear the form when needed.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-10-28 17:10:30 +01:00
Jonathan Druart eea4595f3e
Bug 37732: Fix 'Invalid PIN code' styling for 2FA
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-09-13 12:02:53 +02:00
Jonathan Druart af9701174f
Bug 37732: Fix administration_tasks.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-09-13 12:02:53 +02:00
Jonathan Druart 5b63d200a8
Bug 37748: Adjust the 'Update child to patron' selenium test
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:03 +02:00
Jonathan Druart 4f52463551
Bug 35402: Fix some selenium tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:26 +02:00
Owen Leonard 5fe1ad8ac6
Bug 35402: Update the OPAC and staff interface to Bootstrap 5
This patch updates the OPAC and staff interface to use Bootstrap 5.
Bootstrap CSS assets are now pulled from node_modules and compiled into
staff-global.css and opac.css at build time. This update lays the
foundations of some other chnages, especially the addition of a dark
mode in the future.

Hundreds of templates have been updated, mostly with updates to the grid
markup. Most of the responsive behavior is still the same with the
exception of improved flexibility of headers and footers in both the
OPAC and staff interface.

The other most common change is to add a new "namespace" to data
attributes used by Bootstrap, e.g. "data-bs-target" or "data-bs-toggle".
Modal markup has also been updated everywhere. Other common changes:
dropdown button markup, alert markup (we now use Bootstrap's "alert
alert-warning" and "alert alert-info" instead of our old "dialog alert"
and "dialog info").

Bootstrap 5 now uses CSS variables which we can override in our own
'_variables.scss' (in both the OPAC and staff) to accomplish a lot of
the style overrides which we previously put in staff-global.scss.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-23 15:58:41 +02:00