e2ed
Version:
E2E testing framework over Playwright
14 lines (13 loc) • 642 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.setFilesToUpload = void 0;
const log_1 = require("../utils/log");
/**
* Populates the specified file upload input with file paths.
*/
const setFilesToUpload = async (selector, files, options = {}) => {
const hasManyFiles = Array.isArray(files) && files.length > 0;
(0, log_1.log)(`Populate file upload input with file${hasManyFiles ? 's' : ''} "${String(files)}"`, { options, selector }, 5 /* LogEventType.InternalAction */);
await selector.getPlaywrightLocator().setInputFiles(files, options);
};
exports.setFilesToUpload = setFilesToUpload;