Bug 36148 will be adding a check in our middleware for csrf coverage on post operations - we need selenium tests to cover all scenarios
Created attachment 162532 [details] [review] Bug 36177: Cypress tests - yarn add cypress-mysql
Created attachment 162533 [details] [review] Bug 36177: Cypress tests - cypress-mysql config
Created attachment 162534 [details] [review] Bug 36177: Add Cypress tests This should not be pushed, we are not ready on jenkins. csrf.ts must be run within ktd (not on the host, or 'db' must resolve)
Tomas, can you help here? 'db' needs to be resolved from the container.
(In reply to Jonathan Druart from comment #4) > Tomas, can you help here? 'db' needs to be resolved from the container. 'db' is resolved inside the container, so we should be fine. That said... cannot we ship some template instead, and have a helper script that picks env variables and does what is needed instead? Having that also for the baseUrl and friends would also make it easier for running Cypress on the sandboxes, etc.
Created attachment 162576 [details] [review] Bug 36177: Add Cypress tests
(In reply to Tomás Cohen Arazi from comment #5) > (In reply to Jonathan Druart from comment #4) > > Tomas, can you help here? 'db' needs to be resolved from the container. > > 'db' is resolved inside the container, so we should be fine. Indeed, the tests are passing inside the container. No idea what changed since I wrote them. > That said... cannot we ship some template instead, and have a helper script > that picks env variables and does what is needed instead? Having that also > for the baseUrl and friends would also make it easier for running Cypress on > the sandboxes, etc. Yes, maybe. Feel free to open a new bug and provide a patch. I don't see it as an important need right now.
Created attachment 162984 [details] [review] Bug 36177: Cypress tests - yarn add cypress-mysql Signed-off-by: David Nind <david@davidnind.com>
Created attachment 162985 [details] [review] Bug 36177: Cypress tests - cypress-mysql config Signed-off-by: David Nind <david@davidnind.com>
Created attachment 162986 [details] [review] Bug 36177: Add Cypress tests Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. Ran cypress tests before applying the patches: perl /kohadevbox/misc4dev/run_tests.pl --run-cypress-tests-only 2. Ran the tests again after patches applied (I think I did a yarn there as well to add the new module/package, but I did a reset_all and shut down KTD and restarted as well - not sure of the correct way to do this). Results after patches applied: Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ InfiniteScrollSelect_spec.ts 00:14 4 4 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ KohaTable_spec.ts 00:03 1 1 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Auth/csrf.ts 00:18 6 6 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Agreements_spec.ts 00:31 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/DataProviders_spec.ts 00:49 13 13 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Dialog_spec.ts 00:11 4 4 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Licenses_spec.ts 00:21 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Packages_spec.ts 00:22 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Searchbar_spec.ts 00:11 4 4 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Titles_spec.ts 00:34 6 6 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/UsageReports_spec.ts 00:42 13 13 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/UserRoles_spec.ts 00:03 1 1 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/Settings.ts 00:15 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/Trains.ts 00:20 8 8 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/WaitingList.ts 00:08 3 3 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 05:09 83 83 - - - Done in 349.96s. all good Running [koha-shell kohadev -c "touch testing.success"]...
Created attachment 163035 [details] [review] Bug 36177: Cypress tests - yarn add cypress-mysql Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 163036 [details] [review] Bug 36177: Cypress tests - cypress-mysql config Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 163037 [details] [review] Bug 36177: Add Cypress tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.05! Well done everyone, thank you!
Depends on Bug 36148 not in 23.11.x