docs: function () {
              var elapsedTime = Date.now() - startTime;
  
              if (elapsedTime > timeout) {
                cb(new HeadlessError('Timeout waiting for selector: ' + selector));
                return;
              }
  
              /*eslint-disable handle-callback-err*/
              page.evaluate(function (selector) {
                return document.querySelectorAll(selector).length;
              }, selector, function (err, result) {
                if (result > 0) { // selector found
                  cb();
                } else {
                  setTimeout(testForSelector, timeoutInterval);
                }
              });
            }