UNPKG

e2ed

Version:

E2E testing framework over Playwright

22 lines (21 loc) 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBrowserJsErrors = void 0; const jsError_1 = require("../context/jsError"); const log_1 = require("../utils/log"); /** * Get browser JS errors. */ const getBrowserJsErrors = (options = {}) => { const { showErrorsInLog = false } = options; const jsErrors = (0, jsError_1.getJsErrorsFromContext)(); if (showErrorsInLog === false) { (0, log_1.log)('Get browser JS errors', 5 /* LogEventType.InternalAction */); } else { const logEventStatus = jsErrors.length > 0 ? "failed" /* LogEventStatus.Failed */ : "passed" /* LogEventStatus.Passed */; (0, log_1.log)('Got browser JS errors', { jsErrors, logEventStatus }, 5 /* LogEventType.InternalAction */); } return jsErrors; }; exports.getBrowserJsErrors = getBrowserJsErrors;