https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42980

--- Comment #2 from Pedro Amorim (ammopt) <[email protected]> ---
Created attachment 201432
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201432&action=edit
Bug 42980: Add Cypress tests for the select-all backend selector

Tests cover:
- Bar appears after staging and shows one option per backend
- Select-all applies a backend to all rows where it is enabled
- Select-all skips rows where the selected backend is disabled

Also fixes the existing ILL Batches tests by isolating
AutoILLBackendPriority (saves + clears in beforeEach, restores in
afterEach) so tests don't fail if a previous run left the syspref dirty.

Test plan:
1. Enable ILLModule
2. Install a backend compatible with ILL batches + AutoILLBackendPriority sys
pref:
https://github.com/openfifth/koha-ill-backend-plugin/releases/tag/v2.0.8
3. Install a metadata enrichment plugin (required for ILL batches):
https://github.com/openfifth/koha-plugin-api-pubmed/releases/tag/1.1.1
4. Enable AutoILLBackendPriority sys pref by checking 'PluginBackend'
5. Visit the ILL module:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
6. Notice the 'New ILL requests batch' button shows. Click it.
7. Enter any name, '42' for cardnumber and any library. Click 'Continue'.
8. On the textarea that shows, enter the following pubmed IDs (one per line):
123
321
456
9. Notice that 'PluginBackend' will sometimes be red, sometimes yellow and
sometimes green. This is a test backend and that will happen randomly. Repeat
stepĀ 8) for more test result samples.
10. Notice that when green, 'PluginBackend' will be pre-selected. When yellow,
it'll allow you to select it but not pre-select it. When red it doesn't allow
it to be selected at all.
11. Notice an 'Apply to all rows:' bar appears above the table for each backend
('PluginBackend' and 'Standard').
12. Click 'PluginBackend' on the 'Apply to all rows:' bar. Confirm that all
rows where 'PluginBackend' is green or yellow switch to it. Confirm that rows
where it is red are skipped and stay on 'Standard'.
13. Click 'Standard' on the 'Apply to all rows:' bar. Confirm all
14. Play around with the per-row and select-all selectors, then click 'Add
items to batch' and verify that each request was created with the backend that
was selected for that row.
15. On a fresh ktd (not after going through the test plan), run the Cypress
tests:
yarn cypress run --spec t/cypress/integration/ILL/Batches_spec.ts

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to