Make test automation check for errors in background page
Background
At the moment errors logged to the extension's background page are undetected by the test automation, as long as the extension behaves as expected with the test pages (and unit tests). However, undetected errors logged to the background page usually indicate bugs which might have more severe effects in other than the tested scenarios.
What to change
Add listeners for the error
and unhandledrejection
events and intercept calls to console.error()
in the background page, keep track of the most recent error, and expose it through a message listener. Then in the release automation, message the background page checking for any errors for each test case.
Edited by Sebastian Noack