| Summary: | JS warning should make Cypress tests fail | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
| Status: | Pushed to main --- | QA Contact: | Matt Blenkinsop <matt.blenkinsop> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | lucas, matt.blenkinsop |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | --- | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
25.11.00
|
Circulation function: | |
| Bug Depends on: | |||
| Bug Blocks: | 38201 | ||
| Attachments: |
Bug 40809: Fail Cypress tests on JS warnings
Bug 40809: Fail on DataTables 'warnings' Bug 40809: Fail Cypress tests on JS warnings Bug 40809: Fail on DataTables 'warnings' Bug 40809: Display the whole error Bug 40809: Display the whole error Bug 40809: Also logs args in the console |
||
|
Description
Jonathan Druart
2025-09-15 12:22:57 UTC
Created attachment 186401 [details] [review] Bug 40809: Fail Cypress tests on JS warnings Currently JS warnings during Cypress tests are ignored. This change intercepts console warnings in the browser and if any occurs the test failed This helps catch potential issues and ensures that warnings are not silently ignored during test runs. Test plan: All Cypress tests should still pass. QA will take care of adding a JS warning and confirm that the test fails. Created attachment 186951 [details] [review] Bug 40809: Fail on DataTables 'warnings' They are not in the warn buffer but log DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4 Created attachment 186966 [details] [review] Bug 40809: Fail Cypress tests on JS warnings Currently JS warnings during Cypress tests are ignored. This change intercepts console warnings in the browser and if any occurs the test failed This helps catch potential issues and ensures that warnings are not silently ignored during test runs. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Created attachment 186967 [details] [review] Bug 40809: Fail on DataTables 'warnings' They are not in the warn buffer but log DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4 Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Created attachment 186968 [details] [review] Bug 40809: Display the whole error Not only the first line Created attachment 186969 [details] [review] Bug 40809: Display the whole error Not only the first line Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Created attachment 186977 [details] [review] Bug 40809: Also logs args in the console For an unknown reason there are useful data that are displayed when using console.log that we don't see when throwing the Error This was the purpose of the previous patch (to have everything in Error) but it didn't work. However we can keep it. I'm ignoring this QA failure: Result: [FAIL] t/cypress/support/e2e.js FAIL forbidden_patterns forbidden pattern: console.log (line 41) forbidden pattern: console.log (line 45) Nice work everyone! Pushed to main for 25.11 |