File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -129,15 +129,15 @@ function pageStateToMarkdown(pageState) {
129129}
130130
131131function getBrowserErrors ( logs , type = [ 'error' ] ) {
132- // Playwright console messages
132+ // Playwright & WebDriver console messages
133133 let errors = logs
134- . filter ( log => log . type )
135- . map ( l => ( { type : l . type ( ) , text : l . text ( ) } ) )
136- . filter ( l => type . includes ( l . type ) )
137- . map ( l => l . text )
138-
139- // If console log coming from other helpers they may need other analysis
140- // TODO: Add other helpers analysis
134+ . map ( log => {
135+ if ( typeof log === 'string' ) return log
136+ if ( ! log . type ) return null
137+ return { type : log . type ( ) , text : log . text ( ) }
138+ } )
139+ . filter ( l => l && ( typeof l === 'string' || type . includes ( l . type ) ) )
140+ . map ( l => ( typeof l === 'string' ? l : l . text ) )
141141
142142 return errors
143143}
You can’t perform that action at this time.
0 commit comments