"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.puppeteerMetadata = void 0;
const puppeteer_selector_mapping_1 = require("../utils/puppeteer-selector-mapping");
const puppeteer_text_mapping_1 = require("../utils/puppeteer-text-mapping");
async function puppeteerMetadata(testContext, fnName, proxyContext, rootPage, args, returnValue) {
    const selector = puppeteer_selector_mapping_1.extractPuppeteerSelector(fnName, args);
    const text = puppeteer_text_mapping_1.extractPuppeteerText(fnName, args, returnValue);
    if (selector) {
        testContext.addStepMetadata({ selector });
    }
    if (fnName) {
        testContext.addStepMetadata({ fnName });
    }
    if (text) {
        testContext.addStepMetadata({ text });
    }
}
exports.puppeteerMetadata = puppeteerMetadata;
