How to use the wd.webdriver function in wd

To help you get started, we’ve selected a few wd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jmreidy / grunt-mocha-webdriver / tasks / grunt-mocha-wd.js View on Github external
});
        if (browserFailed) {
          err = new Error('One or more tests on Selenium failed.');
        }
        next(err);
      };
    }
    else {
      grunt.log.writeln('No browsers configured for running on Saucelabs.');
    }
  }
};

//wd.js monkey patch for clearer errors
var _newError = wd.webdriver.prototype._newError;
wd.webdriver.prototype._newError = function (opts) {
  var err = _newError(opts);
  try {
    err = new Error(err.cause.value.message
      .match(/([\s\S]*) caused/)[1]
      .match(/'([\s\S]*)'\n/)[1]
    );
  }
  catch (e) {}
  return err;
};
github jmreidy / grunt-mocha-webdriver / tasks / grunt-mocha-wd.js View on Github external
seleniumServer.kill();
        });
        if (browserFailed) {
          err = new Error('One or more tests on Selenium failed.');
        }
        next(err);
      };
    }
    else {
      grunt.log.writeln('No browsers configured for running on Saucelabs.');
    }
  }
};

//wd.js monkey patch for clearer errors
var _newError = wd.webdriver.prototype._newError;
wd.webdriver.prototype._newError = function (opts) {
  var err = _newError(opts);
  try {
    err = new Error(err.cause.value.message
      .match(/([\s\S]*) caused/)[1]
      .match(/'([\s\S]*)'\n/)[1]
    );
  }
  catch (e) {}
  return err;
};