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