Summary: | Fix and add further cypress tests for Usage reporting | ||
---|---|---|---|
Product: | Koha | Reporter: | Matt Blenkinsop <matt.blenkinsop> |
Component: | ERM | Assignee: | Matt Blenkinsop <matt.blenkinsop> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, pedro.amorim, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00
|
|
Circulation function: | |||
Bug Depends on: | 34587 | ||
Bug Blocks: | |||
Attachments: |
Bug 35229: Update cypress tests for usage reports
Bug 35229: Fix DataProviders_spec.ts Screenshot - test failure Bug 35229: Update cypress tests for usage reports Bug 35229: Fix DataProviders_spec.ts Bug 35229: Update cypress tests for usage reports Bug 35229: Fix DataProviders_spec.ts |
Description
Matt Blenkinsop
2023-11-02 11:11:21 UTC
Created attachment 158250 [details] [review] 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 Created attachment 158991 [details] [review] 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) The tests fail for me - ERM/UsageReports_spec.ts. I started KTD fresh and ran the command in the test plan. Is there anything else I need to do? Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ KohaTable_spec.ts 00:03 1 1 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Agreements_spec.ts 00:31 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/DataProviders_spec.ts 00:43 13 13 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Dialog_spec.ts 00:15 4 4 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Licenses_spec.ts 00:21 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Packages_spec.ts 00:21 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Searchbar_spec.ts 00:05 4 4 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ERM/Titles_spec.ts 00:36 6 6 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✖ ERM/UsageReports_spec.ts 00:53 13 12 1 - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/Settings.ts 00:10 5 5 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/Trains.ts 00:20 8 8 - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ Preservation/WaitingList.ts 00:08 3 3 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✖ 1 of 12 failed (8%) 04:34 72 71 1 - - error Command failed with exit code 1. Created attachment 159003 [details]
Screenshot - test failure
Here is some more detail about the failing test. I've added the screenshot.
Running: ERM/UsageReports_spec.ts (9 of 12)
Reports home tabs
✓ Should display the saved reports page (2596ms)
✓ Should display the custom report builder (4992ms)
Saved reports
✓ Should correctly populate the dropdown menu (2376ms)
✓ Should redirect to the reports viewer with the correct url params (3019ms)
Custom reports
✓ Should limit report types based on the provider(s) selected (3615ms)
✓ Should limit data providers based on the report type(s) selected (3069ms)
✓ Should limit metric types based on the report type(s) selected (2840ms)
✓ Should allow access_type for certain report types (2776ms)
✓ Should disable the month selectors when a yearly report is selected (2414ms)
1) Should correctly allow columns to be selected depending on the report type
✓ Should correctly identify the months selected (3400ms)
✓ Should correctly produce URL parameters based on selected inputs (3301ms)
✓ Should show the Display by year filter when filter is required (5514ms)
12 passing (53s)
1 failing
1) Custom reports
Should correctly allow columns to be selected depending on the report type:
AssertionError: Timed out retrying after 10000ms: Too many elements found. Found '7', expected '6'.
+ expected - actual
-7
+6
at Context.eval (webpack://koha/./t/cypress/integration/ERM/UsageReports_spec.ts:252:51)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 13 │
│ Passing: 12 │
│ Failing: 1 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 1 │
│ Video: true │
│ Duration: 53 seconds │
│ Spec Ran: ERM/UsageReports_spec.ts │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
You may need to run yarn build - there is a minor fix to one of the JS files that may not be picked up by cypress until the JS is re-built (In reply to Matt Blenkinsop from comment #5) > You may need to run yarn build - there is a minor fix to one of the JS files > that may not be picked up by cypress until the JS is re-built That what's the trick! The tests now all pass. Created attachment 159042 [details] [review] 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> Created attachment 159043 [details] [review] 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> Created attachment 159243 [details] [review] 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> Created attachment 159244 [details] [review] 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> Pushed to master for 23.11. Nice work everyone, thanks! |