Commit Graph

21 Commits

Author SHA1 Message Date
Lucas Gass c1efa1f810
Bug 41456: (follow-up) Change item_type to item_type_id and add _strings in test data
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-14 08:50:30 -07:00
Lucas Gass b98f920541
Bug 38262: (follow-up) Add extended_attributes and _strings when inserting test data
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-13 13:52:06 -07:00
Matt Blenkinsop 35ce755ed8
Bug 38201: Cypress fixes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:30 -06:00
Matt Blenkinsop 109804e163
Bug 38201: Add VueFramework cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:16 -06:00
Matt Blenkinsop 3dbd768efd
Bug 38201: DRY out cypress object deletion
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:15 -06:00
Jonathan Druart 1516f227f9
Bug 40665: Fix Cypress tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-09-11 11:35:45 +02:00
David Cook 04c6afaff8
Bug 36135: Fix Cypress test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 08:02:25 -06:00
David Cook 890d9069eb
Bug 15516: Fix Cypress test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 08:02:15 -06:00
Martin Renvoize d9122cd5ac
Bug 40447: Add comprehensive JSDoc documentation to Cypress plugins
This patch adds detailed JSDoc documentation to all Cypress testing
plugin files.

Documentation added to:
- insertData.js: Data insertion utilities with examples
- api-client.js: API wrapper functions with usage patterns
- mockData.js: Schema-based mock data generation
- auth.js: Authentication helper functions
- db.js: Database query utilities
- readYamlFile.js: YAML file reading utilities
- index.js: Main plugin configuration

Each function now includes:
- Complete parameter descriptions with types
- Return value documentation
- Practical usage examples
- Error conditions and handling
- Module-level overviews

This addresses the documentation gap identified during QA review,
hopefully making it easier for future devs to adopt the new framework of
tools.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:30 -06:00
Jonathan Druart 250580016d
Bug 40430: Fix Toolbar_spec.ts
See comment 1 on the bug.

We are adding the capability to insert vendors and baskets.

Test plan:
Confirm that
  yarn cypress run t/cypress/integration/Toolbar_spec.ts
pass, even if you do not have any vendors in DB.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:28 -06:00
Jonathan Druart 56fb5dc52f
Bug 40345: Properly cleanup old checkouts
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:27 -06:00
Jonathan Druart ed2c56ee6e
Bug 40345: Force checkout
Pass the confirmation token to force the checkout

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:26 -06:00
Jonathan Druart 959b7e8f05
Bug 40345: Add insertSamplePatron
So it's easier to build and insert a new patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:25 -06:00
Jonathan Druart 96bb7116b0
Bug 40345: Pass a patron to insertSampleCheckout
So we won't generate a new patron per checkout

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:25 -06:00
Jonathan Druart 19843bd9ba
Bug 40301: Add insertSampleCheckout
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:24 -06:00
Jonathan Druart 5e4032f0f1
Bug 40180: Improve deleteSampleObjects
We want the task to accept an Object or an Array of Objects

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:21 -06:00
Jonathan Druart e3ee3a0541
Bug 40180: Add tests for insertSampleHold
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:21 -06:00
Jonathan Druart af311b5395
Bug 40180: (bug 40118 follow-up) Add Cypress tests
This patch heavily reuses what has been introduced by the previous
patches in the tree, and add a insertSampleHold task to be reusable
easily in other tests.

Test plan:
All Cypress tests must pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:20 -06:00
Jonathan Druart 9ca9d1e764
Bug 40174: Use api-client
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:18 -06:00
Jonathan Druart 52c57538c7
Bug 40174: Introduce Cypress auth plugin
So we can easily retrieve the value for the Authorization header.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:17 -06:00
Jonathan Druart 892df0f0c0
Bug 40174: Allow proper E2E testing with Cypress
This is the first step toward implementing true end-to-end testing with
Cypress.

Until now, we have been mocking responses using cy.intercept(), but this
approach can lead to confusion. In some cases, we have even had to mock
global JavaScript variables, which makes the code unnecessarily complex
and unconventional (e.g. win.categories_map).

All the bug reports listed under this tree have helped lay the
groundwork for this patch. With it, we are able to build mock objects
(via plugin mockData) and insert them directly into the database
(insertData). Once the tests are complete, we’ll restore the database to
its previous state by removing any data generated during the tests.

The tests in KohaTable/Holdings_spec.ts have been updated to leverage
this new setup.

Additionally, a caching mechanism has been added to prevent _id
attributes from being generated with the same values (a rare issue we
occasionally encountered).

While this is still not a perfect solution, it introduces a solid
foundation for future improvements.

Test plan:
All Cypress tests must pass

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:17 -06:00