"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldCaptureFailureScreenshot = shouldCaptureFailureScreenshot;
exports.attachFailureScreenshot = attachFailureScreenshot;
const cucumber_1 = require("@cucumber/cucumber");
function shouldCaptureFailureScreenshot(status, enabled) {
    return enabled && status === cucumber_1.Status.FAILED;
}
async function attachFailureScreenshot(world) {
    if (!world.page) {
        return;
    }
    const screenshot = await world.page.screenshot({ fullPage: true });
    await world.attach(screenshot, 'image/png');
}
