async function evalFunc({ callback, args }) {
    let fn;
    try {
      fn = new Function(`return ${callback}`)();
    } catch (error) {
      throw new Error(
        `Error evaluating the callback function: ${error.message}`,
      );
    }
    return await fn(this, args);
  }
Evaluates script on element matching the given selector.

@example
await evaluate(link("something"), (element) => element.style.backgroundColor)
@example
await evaluate((element) => {
     element.style.backgroundColor = 'red';
})
@example
await evaluate(() => {
  // Callback function have access to all DOM APIs available in the developer console.
  return document.title;
} )
@example
let options = { args: [ '.main-content', {backgroundColor:'red'}]}

await evaluate(link("something"), (element, args) => {
     element.style.backgroundColor = args[1].backgroundColor;
     element.querySelector(args[0]).innerText = 'Some thing';
}, options)

@param {selector|string} selector - Web element selector.
@param {function} callback - callback method to execute on the element or root HTML element when selector is not provided.<br>
NOTE : In callback, we can access only inline css not the one which are define in css files.
@param {Object} options - options.
@param {boolean} [options.waitForNavigation=true] - Wait for navigation after the click. Default navigation timeout is 15 seconds, to override pass `{ navigationTimeout: 10000 }` in `options` parameter.
@param {number} [options.waitForStart=100] - wait for navigation to start. Accepts value in milliseconds.
@param {number} [options.navigationTimeout=5000] - Navigation timeout value in milliseconds for navigation after click.
@param {Array} options.args - Arguments to be passed to the provided callback.
@param {string[]} [options.waitForEvents = []] - Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']
@param {boolean} [options.silent=false] - Set true to run script silently without printing messages.
@returns {Promise<Object>} Object with return value of callback given.