Skip to content

Commit 4810867

Browse files
author
DavertMik
committed
added change fot pageInfo plugin
1 parent 6e5d017 commit 4810867

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/plugin/pageInfo.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ function pageStateToMarkdown(pageState) {
129129
}
130130

131131
function 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
}

0 commit comments

Comments
 (0)