testaro 32.3.3 → 32.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/run.js +10 -3
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -426,16 +426,23 @@ const launch = async (report, typeName, url, debug, waits, isLowMotion = false)
|
|
|
426
426
|
browserContext.setDefaultTimeout(0);
|
|
427
427
|
// When a page (i.e. browser tab) is added to the browser context (i.e. browser window):
|
|
428
428
|
browserContext.on('page', async page => {
|
|
429
|
+
// Ensure the report has a jobData property.
|
|
430
|
+
report.jobData ??= {};
|
|
431
|
+
report.jobData.logCount ??= 0;
|
|
432
|
+
report.jobData.logSize ??= 0;
|
|
433
|
+
report.jobData.errorLogCount ??= 0;
|
|
434
|
+
// Add any error events to the count of logging errors.
|
|
429
435
|
page.on('crash', () => {
|
|
436
|
+
report.jobData.errorLogCount++;
|
|
430
437
|
console.log('Page crashed');
|
|
431
438
|
});
|
|
432
439
|
page.on('pageerror', () => {
|
|
433
|
-
|
|
440
|
+
report.jobData.errorLogCount++;
|
|
434
441
|
});
|
|
435
442
|
page.on('requestfailed', () => {
|
|
436
|
-
|
|
443
|
+
report.jobData.errorLogCount++;
|
|
437
444
|
});
|
|
438
|
-
// If
|
|
445
|
+
// If the page emits a message:
|
|
439
446
|
page.on('console', msg => {
|
|
440
447
|
const msgText = msg.text();
|
|
441
448
|
let indentedMsg = '';
|