e2ed
Version:
E2E testing framework over Playwright
21 lines (20 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.afterErrorInTest = void 0;
// eslint-disable-next-line import/no-internal-modules
const getBrowserConsoleMessages_1 = require("../../actions/getBrowserConsoleMessages");
// eslint-disable-next-line import/no-internal-modules
const getBrowserJsErrors_1 = require("../../actions/getBrowserJsErrors");
const promise_1 = require("../promise");
const takeScreenshotsOnErrorIfNeeded_1 = require("./takeScreenshotsOnErrorIfNeeded");
const afterErrorInTestTimeoutInMs = 15_000;
/**
* Internal "after error in test" hook.
* @internal
*/
const afterErrorInTest = (testStaticOptions) => (0, promise_1.addTimeoutToPromise)((async () => {
(0, getBrowserConsoleMessages_1.getBrowserConsoleMessages)({ showMessagesInLog: true });
(0, getBrowserJsErrors_1.getBrowserJsErrors)({ showErrorsInLog: true });
await (0, takeScreenshotsOnErrorIfNeeded_1.takeScreenshotsOnErrorIfNeeded)(testStaticOptions);
})(), afterErrorInTestTimeoutInMs);
exports.afterErrorInTest = afterErrorInTest;