test: enhance console error logging with type tags
This commit is contained in:
parent
39beed3172
commit
16d9a0e205
@ -23,9 +23,9 @@ test.describe('Web Component E2E Tests', () => {
|
|||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
if (!subscribedToAppErrors) {
|
if (!subscribedToAppErrors) {
|
||||||
page.on('console', (msg) => {
|
page.on('console', (msg) => {
|
||||||
if (msg.type() === 'error') {
|
const type = msg.type();
|
||||||
console.error(`Console Error: ${msg.text()}`);
|
const tag = type === 'error' ? 'ERROR' : type === 'warning' ? 'WARNING' : 'LOG';
|
||||||
}
|
console.log('[' + tag + ']', msg.text());
|
||||||
});
|
});
|
||||||
subscribedToAppErrors = true;
|
subscribedToAppErrors = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user