Commit graph

18 commits

Author SHA1 Message Date
3143549403
Bug 33402: Move ERM Cypress tests to their own directory
We need to move the existing Cypress tests (that are ERM only, t/cypress/integration/*.ts )
to their own subdirectory, eg t/cypress/integration/ERM

Test plan:
Confirm that the cypress tests are still passing after this change:
  perl /kohadevbox/misc4dev/run_tests.pl --run-cypress-tests-only

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-12 09:26:45 -03:00
0a89bf85e0
Bug 33066: Fix cypress tests
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-10 07:38:52 -03:00
0b16749efb
Bug 33422: Add cypress test
This patch adds a cypress test to check whether the "active" class is correctly updating when navigating

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-06 09:29:30 -03:00
b88d364018 Bug 33282: Feed an array of titles so that no dialog message appears
Including but not limited to the one we're testing for

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-03-24 09:12:56 +01:00
f718fe6a0a Bug 33282: Move get_title to index.js to be invoked by different specs
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-03-24 09:12:53 +01:00
a56cbc6d47 Bug 33282: Remove useless intercept
JD amended patch: replace "redundant" with "useless". It's not the same
intercept, but we don't need the one removed by this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-03-24 09:12:53 +01:00
7c5d0a208d Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-03-24 09:12:53 +01:00
16e6d93763
Bug 33235: Fix cypress tests
Some inconsistencies leftovers from 32495 and 32997 were causing cypress tests to fail, this fixes them.

* Apply patch
* Run cypress tests and verify all pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-17 09:59:05 -03:00
dc40b5dd08
Bug 32991: Add cypress tests for the dialog box
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-10 11:15:35 -03:00
48b39533f6
Bug 32991: Fix cypress tests. Added new test for when deleting from show view.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-10 11:15:33 -03:00
b312b63136
Bug 32925: Add test
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-27 11:14:11 -03:00
53bebb413a
Bug 32898: Avoid hardcoding user/pass in tests
This patch makes the authentication parameters be configurable through
env. Before this, it was hardcoded to koha/koha, which only works if the
ktd defaults haven't been tweaked.

If no env is defined, it fallsback to koha/koha.

In order to pass the ktd configured params, the tests need to be run
like:

$ yarn cypress run --env KOHA_USER=$KOHA_USER,KOHA_PASS=$KOHA_PASS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-21 09:10:15 -03:00
a294c5e901
Bug 32898: ERM - Improve fetch
... and fix cypress tests

The main problem was that there were no more checkError call for fetchLocalTitleCount
and the error was not displayed on the UI.

This commit is doing several things:
- Refactor fetch.js to call the same fetch method (myFetch) in order to
deal with the error in a single place
- Have a new myFetchTotal JS function to get the X-Total-Count header
from the response and get the benefit of the previous refactoring
- Rename fetchCountLocalPackages with fetchLocalPackagesCount to match fetchLocalTitleCount
- Use fetchLocalPackagesCount on the Package list view
- Use checkError from components using fetch directly. Ideally the could
should be moved to fetch.js and myFetch should be used.
- checkError get a new flag in parameter to ask for the response instead
of the result (ie. the JSON of the response). That's useful when we need
the response status or the headers
- Make checkError throw a proper exception to stop propation. This
modify the error we display on the UI, it's why we have the following
changes in cypress tests:
-            "Something went wrong: Internal Server Error"
+            "Something went wrong: Error: Internal Server Error"
That's not ideal, we should have our own JS exception to avoid that
"Error" (coming from the toString call on the error)

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-21 09:10:14 -03:00
61656983f2
Bug 32898: Fix Cypress tests
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-21 09:10:09 -03:00
a711e153d6
Bug 32131: Make sure we login before we restore original pref's value
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-17 13:39:46 -03:00
fc48e6117f
Bug 32131: Move set_ERM_sys_pref_value to before
We cannot (yet) move login to before, but we can set the pref before all
the tests. We need to login in before anyway to retrieve the value of
the pref.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-17 13:39:45 -03:00
5d794c99cc
Bug 32131: Cypress tests are failing if ERMModule is off
This patch solves this by enabling the system preference before each test,
right after login. It also sets the system preference back to its original
initial value after the tests finish running.

To test:
1) Disable ERMModule system preference
2) Run cypess tests: yarn cypress open / yarn cypress run
3) Verify that tests run successfully
(Optional): While tests are running, visit the system preferences panel and verify that the system preference is now "Enable".
4) Wait for the tests to finish and confirm that the system preference is set back to its original "Disable" value.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-17 13:39:45 -03:00
4f1f8bb4ea
Bug 32030: Move cypress to t/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-08 09:44:51 -03:00