UNPKG

@applitools/screenshoter

Version:

Applitools universal screenshoter for web and native applications

15 lines (12 loc) 495 B
const utils = require('@applitools/utils') /** * Handles waiting for a specified duration or until a condition is met. * using `wait` as a number should not happen with new core versions, but we still support it for backward compatibility * @param {*} wait - The wait duration (in milliseconds) or a function that returns a promise. * */ async function handleWait(wait) { if (typeof wait === 'function') await wait() else await utils.general.sleep(wait) } module.exports = handleWait