dialog = (dialogType, dialogMessage, callback) => {
  validate();
  let resolver = null;
  if (dialogType === "beforeunload") {
    promisesToBeResolvedBeforeCloseBrowser.push(
      new Promise((resolve) => {
        resolver = resolve;
      }),
    );
  }
  const _callback = isFunction(dialogMessage) ? dialogMessage : callback;
  const eventName = isFunction(dialogMessage)
    ? dialogType
    : createJsDialogEvent(dialogMessage, dialogType);

  if (!isFunction(dialogMessage)) {
    eventRegexMap.set(eventName, new RegExp(dialogMessage));
  }

  return eventHandler.once(eventName, async (args) => {
    await _callback(args);
    resolver?.();
  });
}
Lets you configure global configurations.

@example
setConfig( { observeTime: 3000});

@param {Object} options
@param {number} [options.navigationTimeout = 30000 ] Navigation timeout value in milliseconds for navigation after performing
<a href="#opentab">openTab</a>, <a href="#goto">goto</a>, <a href="#reload">reload</a>, <a href="#goback">goBack</a>,
<a href="#goforward">goForward</a>, <a href="#click">click</a>, <a href="#write">write</a>, <a href="#clear">clear</a>,
<a href="#press">press</a> and <a href="#evaluate">evaluate</a>.
@param {number} [options.observeTime = 3000 ] Option to modify delay time in milliseconds for observe mode.
@param {number} [options.retryInterval = 100 ] Option to modify delay time in milliseconds to retry the search of element existence.
@param {number} [options.retryTimeout = 10000 ] Option to modify timeout in milliseconds while retrying the search of element existence.
@param {boolean} [options.observe = false ] Option to run each command after a delay. Useful to observe what is happening in the browser.
@param {boolean} [options.waitForNavigation = true ] Wait for navigation after performing <a href="#goto">goto</a>, <a href="#click">click</a>,
<a href="#doubleclick">doubleClick</a>, <a href="#rightclick">rightClick</a>, <a href="#write">write</a>, <a href="#clear">clear</a>,
<a href="#press">press</a> and <a href="#evaluate">evaluate</a>.
@param {string[]} [options.waitForEvents = []] - Wait for events after performing <a href="#goto">goto</a>, <a href="#click">click</a>,
<a href="#doubleclick">doubleClick</a>, <a href="#rightclick">rightClick</a>, <a href="#write">write</a>, <a href="#clear">clear</a>,
<a href="#press">press</a> and <a href="#evaluate">evaluate</a>. Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle',
'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']
@param {boolean} [options.ignoreSSLErrors = true ] Option to ignore SSL errors encountered by the browser.
@param {boolean} [options.headful = false ] Option to open browser in headless/headful mode.
@param {boolean} [options.highlightOnAction = false ] Option to highlight an element on action.