Commit Graph

236 Commits

Author SHA1 Message Date
Jonathan Druart 6da4c46de5
Bug 40444: Fix onboarding and installer selenium tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c456dd86b4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-09-16 14:02:27 +02:00
Jonathan Druart 319d6f88cd
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>
(cherry picked from commit 63eb2e1f4a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-09-16 14:02:25 +02:00
Jonathan Druart c4f54429a7
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>
(cherry picked from commit 0e12c572e8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-24 10:23:39 +02:00
Jonathan Druart fc9647c5ac
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>
(cherry picked from commit 5f44a5ef5a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:37 +02:00
Jonathan Druart da06ce47c0
Bug 40129: Fix selenium tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d538261fd4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:32 +02: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
Nick Clemens d5f0191bda
Bug 37373: (follow-up) Add id and adjust tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-08 15:53:28 +02:00
Pedro Amorim 6e1f317010
Bug 37283: Update expected error page title
I dont know how this was working before, but if we do:
cat -n /usr/share/perl5/HTTP/Response.pm | grep Error

We notice that error_as_HTML returns 'An Error Occurred' for page title and that is what we should be expecting?

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Caused by bug 37056.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-09 14:56:02 +02:00
Jonathan Druart 69c64bcb72
Bug 35362: Adjust other "Close window" clicks
Previous patch "Bug 35362: (follow-up) Fix guaruntor preview modal close in test"
didn't adjust the other occurrences.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-14 15:34:26 +02:00
Jonathan Druart 5c43883a7c
Bug 36582: Fix regressions.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-10 14:11:41 +02:00
Martin Renvoize f08bb43222
Bug 35362: (follow-up) Fix guaruntor preview modal close in test
This patch updates the selenium test to correct the selector used to
close the preview modal as it changed with this patchset.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:14:47 +02:00
Jonathan Druart 92a4c99e24
Bug 30645: Add tests
to highlight the problem

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 08:52:48 +02:00
Nick Clemens 9aa811c334
Bug 23102: No mock in selenium
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-12 12:12:31 +02:00
Nick Clemens fee56e8d85
Bug 23102: Selenium test
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-12 12:12:29 +02:00
Pedro Amorim f8665c8d55
Bug 34886: Comment failing tests
These tests highlight the fact that the 'place hold' button visibility in the
search results page **does not** match the 'place hold' button visibility in
the detail page, given the same conditions.
Since that this is a known behavior, these tests should be commented out as they
are failing by design.

prove t/db_dependent/selenium/opac_holds.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-02 17:59:08 +02:00
Marcel de Rooy ae44fd1889
Bug 34886: (QA follow-up) chmod, remove POD
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-02 17:59:07 +02:00
Pedro Amorim 3758a8c05e
Bug 34886: Add selenium tests
Tests added to cover different use cases and combinations of circulation rules values for authenticated and unauthenticated users
At the moment, 2 tests are failing, documented on the [DO NOT PUSH] commit.
These 2 failing tests fail for the search results page but pass on the detail page counterpart. Ideally they should match, for consistency sake.
But this may be the use case "details page should be more correct, results page is always an approximation" mentioned by Nick.

More test combinations may be added in the future.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-02 17:59:07 +02:00