How to use the browserstack.createClient function in browserstack

To help you get started, we’ve selected a few browserstack 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 dbrans / browserstack-cli / bin / cli.js View on Github external
if(cmd.user) {
    // get auth from commandline
    auth = parseUser(cmd.user);
  } else if(config.username && config.password) {
    // get auth info from config
    auth = {
      username: config.username,
      password: config.password
    };
  } else {
    console.error('Authentication required. Use option "--user" or put a "username" and "password" in ' + CONFIG_FILE);
    process.exit(1);
  }

  return browserstack.createClient(extend(settings, auth));
}
github ryanseddon / bunyip / lib / helpers.js View on Github external
var browserstack = require("browserstack"),
	config = require("./config");

var workers = [],
	timeout = config.browserstack.timeout || 480, // 8 minutes
	client = browserstack.createClient(config.browserstack),
	osMap = {};

var	loadBrowsers = function(browsers) {
		browsers.forEach(function(browser, idx){
			client.createWorker(browser, function(err, worker){
				if(err) {
					console.log(err);
					console.log("Whoops! BrowserStack failed to create a worker: %s", err);
				} else {
					console.log("  BrowserStack "+ (browser.browser || browser.device) + " " + browser.version +" worker launched: %s", worker.id);
					workers.push(worker.id);
				}
			});
		});
	},
	availableBrowsers = function(cb) {
github clarkbox / testswarm-browserstack / lib / testswarm-browserstack.js View on Github external
client:function () {
        if (self._client) {
            return self._client;
        }
        self._client = BrowserStack.createClient({
            username:self.options().user,
            password:self.options().pass
        });
        return self._client;
    },
github peers / peerjs-test / run.js View on Github external
var BrowserStack = require( "browserstack" );
var keys = JSON.parse(require('fs').readFileSync('./keys'));
var client = BrowserStack.createClient(keys);

var async = require('async');

var Runner = {};

Runner.kill = client.terminateWorker.bind(client);

Runner.killAll = function(cb) {
  client.getWorkers(function(err, workers){
    if (err) {
      return cb(err);
    }
    async.each(workers, function(worker, eachCb) {
      client.terminateWorker(worker.id, eachCb);
    }, function(err) {
      cb(err);
github browserstack / browserstack-runner / bin / cli.js View on Github external
exports.run = function(user_config, callback) {
  callback = callback || function() {};

  try {
    config = new (require('../lib/config').config)(user_config);

    client = BrowserStack.createClient({
      username: config.username,
      password: config.key
    });
    runTests(config, function(error, report) {
      cleanUpAndExit('SIGTERM', error, report, callback);
    });
  } catch (e) {
    callback(e);
  }
};
github unsetbit / queen / lib / server / populator / browserstack.js View on Github external
var BrowserStackPopulator = function(settings){
	this.client = browserstack.createClient(settings);
	this.clients = [];
};