Closed oflorko closed 4 years ago
@oflorko The filtering function should return true if the log is to be visible, false otherwise. The code you have here seems to only return true if it's an "error" and the "body" does not contain "google-analytics.com".
event.body
does not exist either, so I doubt this will work. Check the DevTools documentation for the types:
@flotwig Thank you for your fast reply it actually helped us. Here is the solution:
module.exports = (on, config) => {
require('cypress-log-to-output').install(on, (type, event) => {
if (event.level === 'error' || event.type === 'error') {
if (event.url !== undefined && event.url.indexOf('google-analytics.com') > 0) return false
else return true
}
return false
})
Great! Glad to hear you got it working.
Dear developers,
Thank you for a useful plugin that allows us to catch more errors during CI runs! To make it more readable is it possible to filter out error logs that we are not interested in like:
This code doesn't work for me:
Could you please suggest something?