Commit graph

57 commits

Author SHA1 Message Date
fb1c01452d
Bug 35229: Fix DataProviders_spec.ts
The intercept was wrong:
Was intercepting GET instead of POST
Was intercepting /run route intead of /process_SUSHI_response (this naming was updated in the rest of the code but not here)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:27:26 -03:00
e56153c510
Bug 35229: Update cypress tests for usage reports
This patch adds some additional tests for usage reports to improve test coverage.
It also fixes a small error in the reports store - "platforms" v "platform". This was affecting which columns could be selected for platform reports

Test plan:
yarn cypress run
All tests should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:27:26 -03:00
55eea9b3c5
Bug 34587: Updated cypress tests
Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 05cf3d9f6a7ddf163d2e144436a6ff8e5854d7e4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:32 -03:00
17cf580f19
Bug 34587: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:32 -03:00
9fc2151ead
Bug 34587: Remove begin_date and end_date as usage_data_providers properties/columns
(cherry picked from commit 9339eed9358301f7bf17934e2e13fc17205d9cd0)

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:14 -03:00
cbe5e86fe8
Bug 34587: Cypress update
Update the cypress tests to reflect recent changes

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:06 -03:00
e46321b31e
Bug 34587: Add cypress tests for Data providers
Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:04 -03:00
28f309cbf9
Bug 35201: (bug 30708 follow-up) Fix Preservation/Settings.ts
We were not correctly mocking the config route from the tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:45:51 -03:00
f151895e08
Bug 35201: (bug 30708 follow-up) Fix Preservation tests
We didn't mock the config given the last changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:45:51 -03:00
df3acf3d68
Bug 35199: (bug 34448 follow-up) Fix error handling in http-client.js
From bug bug 34448.

386         // Submit the form, get 500
387         cy.intercept("POST", "/api/v1/erm/agreements", {
388             statusCode: 500,
389             error: "Something went wrong",
390         });
391         cy.get("#agreements_add").contains("Submit").click();
392         cy.get("main div[class='dialog alert']").contains(
393             "Something went wrong: SyntaxError: Unexpected end of JSON input"
394         );

This is wrong: we are now showing a JS error (SyntaxError) instead of the expected 500: internal server error!

The problem was that a regular 500 does not have anything in the body,
and _fetchJSON didn't handle that ( JSON.parse(text) ).
If the body of the response does not contain anything we need to get the
text from statusText (which contains "Internal Server Error" in case of
500).

Test plan:
1. Make sure all cypress tests pass
2. Confirm the above:
Raise an exception from a given route (/agreements for instance) and
confirm that the error displayed on the interface is correct (ie. not
SyntaxError, but "Error: Internal Server Error")

For QA:
* This change is covered properly in Dialog_spec.ts, no need to redo it in
every other test files.
* Without the following change in count, we see:
"Something went wrong: Error: Error: Internal Server Error" because
setError is called twice. We don't need to set the error from count, it
has been set from _fetchJSON already.
-            error => {
-                setError(error.toString());
-            }
+            error => {}

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:45:50 -03:00
d1c31da24d
Bug 30708: Fix Trains.ts tests
Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:56 -03:00
3e6c15f631
Bug 30708: Set default values for items added in batch to a train
Technical notes: Ideally we would have split TrainsFormAddItem to make some part
reusable, but it turned out into a complicated component that would have
been hard to maintain. It seems easier to have two different components.
Ideas to improve this area are welcome!

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:52 -03:00
d929ef8951
Bug 30708: Allow modifying attribute linked with AV to another value
If a value is not in the AV list, or if it differs slightly, they would
like to force the modification of the value, without creating a new
authorised value.

Note that this could be a candidate for an option at the attribute
level if there are different needs (ie. for some attributes we don't
want to allow an other value).

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:51 -03:00
1030e04e8c
Bug 30708: Allow attributes to be multivalued
This is not working as it, but we are going to fix the problem when
working on the "Set default values for items added in batch to a train"

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:50 -03:00
4e9bc78f2c
Bug 30708: Add tests
Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:39 -03:00
4ec7c6a62e
Bug 34789: Update unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-18 12:06:19 -03:00
95b43b6c61
Bug 33480: Tidy tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-06 15:05:26 -03:00
23744e7ef1
Bug 33480: (QA follow-up) Add cypress tests:
Add tests for vendor aliases
Test plan:
perl /kohadevbox/misc4dev/run_tests.pl --run-cypress-tests-only

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-06 15:05:26 -03:00
ee9982ed5b
Bug 34217: Add vendor tests for licenses
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-06 09:57:07 -03:00
8522fc5d2a
Bug 34217: Add vendor tests for agreements
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-06 09:57:05 -03:00
e3d579a018
Bug 34690: Fix dialog_spec.ts
Run the tests, verify they fail
Apply this patch, run tests again, verify they now pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 14:35:32 -03:00
dc91fd9bb9
Bug 34690: Make the test fail consistently
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I amended the commit title
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 14:35:32 -03:00
4f45300d91
Bug 34319: Upgrade cypress 9.7.0 to 12.17.2
We are currently using 9.7.0. Since 10 the config file structure changed, and has been renamed cypress.json to cypress.config.ts

https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-version-10-0

Also cypress-studio (used for bug 34076) is not working on 9.7.0.

Test plan:
yarn install
yarn build
mv /root/.cache/Cypress/12.17.2/ /kohadevbox/Cypress/
perl /kohadevbox/misc4dev/run_tests.pl --run-cypress-tests-only

You should not get any failures from the tests.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 11:52:25 -03:00
6b74b5df5a
Bug 34691: Add cypress tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-01 11:23:31 -03:00
0312acc211
Bug 34448: Update cypress tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-01 11:23:21 -03:00
68baf8a7c1
Bug 34466: Cypress tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-01 11:07:32 -03:00
feeb288e30
Bug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app
This could be extended later in bug 32968 to pass the permission of the
logged in user.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-06 12:24:13 -03:00
f461095909
Bug 33625: Tidy remaining cypress test files
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:04 -03:00
1139972748 Bug 33625: Pretty .js files for vue
Test plan:
= Koha =
Apply the first patch, prove xt/vue_tidy.t and notice the failure
Apply this patch, now it passes

= QA test =
Apply the change to the merge request linked with this qa-test-tools' issue:
https://gitlab.com/koha-community/qa-test-tools/-/issues/62
inside your ktd container (at /kohadevbox/qa-test-tools/)
Edit a .js within koha-tmpl/intranet-tmpl/prog/js/vue and a .ts file
(cypress test) with something not pretty
Commit and run the QA script
=> It's failing!
Pretty the change, commit again, run the QA script
=> It's happy!

= KTD - git hook =
Go to the merge request linked with this ktd's issue:
https://gitlab.com/koha-community/koha-testing-docker/-/issues/374
Copy the modified git hook to .git/hooks/ktd/pre-commit
Edit a .js within koha-tmpl/intranet-tmpl/prog/js/vue and a .ts file
(cypress test) with something not pretty
Commit
=> Notice that the commit content is pretty!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-16 11:38:04 +02:00
5b3d848b2e
Bug 33064: Update cypress tests
This patch amends Searchbar_spec.ts to account for the new licenses option

Test plan:
1) Run yarn cypress open
2) Select the Searchbar_spec.ts test
3) The test should pass

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:22 -03:00
80d73b87c4
Bug 33490: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:37 -03:00
f9cb6b823e
Bug 33490: Make url consistent
This ensures we populate the max_expiration_date param on the browser
url for consistency with selected dates.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:34 -03:00
6f68b350ba
Bug 33490: Unit tests
This patch adds cypress tests for the filter by expired functionality in
the ERM Agreements page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:33 -03:00
5a39823dbc
Bug 33416: Fix Searchbar_spec.ts
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-19 09:20:56 -03:00
2167028025
Bug 33416: Fix Agreements.ts
<failure message="Timed out retrying after 10000ms: Expected to find element: `#agreements_list table tbody tr:first`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying a
fter 10000ms: Expected to find element: `#agreements_list table tbody tr:first`, but never found it.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-19 09:20:56 -03:00
0f01c16ba1
Bug 33408: Remove obsolete tests and template sys pref code
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-13 11:48:02 -03:00
0efb53b3a2
Bug 33408: Prevent access to erm module by URL if sys pref is disabled
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-13 11:48:01 -03:00
2579b95db9
Bug 33408: Mock ERM sysprefs from cypress tests
Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-13 11:47:59 -03:00
7c8c983795
Bug 33402: (follow-up) Move Searchbar_spec.ts
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-12 11:21:50 -03:00
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