How to use the browserstack.user 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 bugsnag / bugsnag-js / test / browserstack.js View on Github external
browser_version: '7.0',
    os: 'OS X',
    os_version: 'Mavericks'
  },
  firefox: {
    browser: 'Firefox',
    browser_version: '26.0',
    os: 'Windows',
    os_Version: '8'
  }
};


// Input capabilities
var capabilities = browsers[process.argv[2]];
capabilities['browserstack.user'] = 'conrad10';
capabilities['browserstack.key'] = process.env.BROWSERSTACK_KEY || process.exit(console.log('no BROWSERSTACK_KEY set'));

var driver = new webdriver.Builder().
usingServer('http://hub.browserstack.com/wd/hub').
withCapabilities(capabilities).
build();

driver.get('http://jelzo.com:6123/bugsnag/');
var tries = 0;

function check() {
  driver.getTitle().then(function(title) {
    if (title) {
      console.log(title);
      driver.quit();
    } else if (tries < 10) {
github jwplayer / jw-showcase / protractor.browserstack.conf.js View on Github external
function createCapabilities (capabilities, tags) {

    capabilities['browserstack.user']             = env.BROWSERSTACK_USER || env.BS_USERNAME;
    capabilities['browserstack.key']              = env.BROWSERSTACK_KEY || env.BS_AUTHKEY;
    capabilities['browserstack.local']            = true;

    // Selenium 3.4.0 does not work great with IE11
    if (capabilities.browserName !== 'internet explorer') {
        capabilities['browserstack.selenium_version'] = '3.4.0';
    }

    capabilities.project = pkg.name;
    capabilities.build   = env.BROWSERSTACK_BUILD || pkg.version;

    capabilities.cucumberOpts = {
        format: 'json:./test/reports/' + composeReportName(capabilities) + '.json'
    };

    if (tags) {
github orizens / echoes / config / config / config.protractor.js View on Github external
export function configProtractor() {
    var browserstack = extend(true /* Deep copy. */, {}, protractorUtils.platform.browserstack);

    var protractorBaseConfig = {
        specs: __dirname + '/../../tests/e2e/*.js'
    };

    // browserstack.capabilities['browserstack.user'] = process.env.BROWSERSTACK_USER;
    browserstack.capabilities['browserstack.user'] = process.env.bs_user;
    // browserstack.capabilities['browserstack.key'] = process.env.BROWSERSTACK_KEY;
    browserstack.capabilities['browserstack.key'] = process.env.bs_key;
    browserstack.capabilities['browserstack.local'] = 'true';

    return {
        configList: [
            /* OS X / Chrome. */
            protractorUtils.mergeConfig({
                configList: [
                    protractorBaseConfig,
                    browserstack,
                    protractorUtils.os.osx,
                    protractorUtils.browser.chrome
                ]
            }),
            // /* OS X / Safari. */
github angular / protractor / lib / driverProviders / browserStack.ts View on Github external
protected setupDriverEnv(): Promise {
    this.config_.capabilities['browserstack.user'] = this.config_.browserstackUser;
    this.config_.capabilities['browserstack.key'] = this.config_.browserstackKey;
    this.config_.seleniumAddress = 'http://hub.browserstack.com/wd/hub';

    // Append filename to capabilities.name so that it's easier to identify
    // tests.
    if (this.config_.capabilities.name && this.config_.capabilities.shardTestFiles) {
      this.config_.capabilities.name +=
          (':' + this.config_.specs.toString().replace(/^.*[\\\/]/, ''));
    }

    logger.info('Using BrowserStack selenium server at ' + this.config_.seleniumAddress);
    return Promise.resolve();
  }
}
github jwplayer / jw-showcase / protractor.conf.browserstack.js View on Github external
function (capabilities) {
        capabilities['browserstack.user']  = BROWSERSTACK_USER;
        capabilities['browserstack.key']   = BROWSERSTACK_KEY;
        capabilities['browserstack.local'] = true;

        // Selenium 3.6.0 does not work great with IE11
        if (capabilities.browserName !== 'internet explorer') {
            capabilities['browserstack.selenium_version'] = '3.4.0';
        }

        capabilities.project = pkg.name;
        capabilities.build   = env.BROWSERSTACK_BUILD || pkg.version;

        if (capabilities.browserName === 'internet explorer') {
            capabilities.ignoreProtectedModeSettings = true;
        }

        return capabilities;
github angular / protractor / lib / driverProviders / browserStack.ts View on Github external
protected async setupDriverEnv(): Promise {
    this.config_.capabilities['browserstack.user'] = this.config_.browserstackUser;
    this.config_.capabilities['browserstack.key'] = this.config_.browserstackKey;
    this.config_.seleniumAddress = 'http://hub.browserstack.com/wd/hub';

    this.browserstackClient = BrowserstackClient.createAutomateClient({
      username: this.config_.browserstackUser,
      password: this.config_.browserstackKey,
      proxy: this.config_.browserstackProxy
    });

    // Append filename to capabilities.name so that it's easier to identify
    // tests.
    if (this.config_.capabilities.name && this.config_.capabilities.shardTestFiles) {
      this.config_.capabilities.name +=
          (':' + this.config_.specs.toString().replace(/^.*[\\\/]/, ''));
    }
github axemclion / browser-perf / test / unit / options / browsers.spec.js View on Github external
it('should parse browserstack credentials', function() {
			var res = test({
				browser: ['chrome', 'firefox'],
				BROWSERSTACK_USERNAME: 'username',
				BROWSERSTACK_KEY: 'key',
				selenium: 'hub.browserstack.com'
			});
			expect(res.browsers.length).to.eq(2);
			expect(res.browsers[0]['browserstack.user']).to.eq('username');
			expect(res.browsers[0]['browserstack.key']).to.eq('key');
			expect(res.browsers[1]['browserstack.user']).to.eq('username');
			expect(res.browsers[1]['browserstack.key']).to.eq('key');
		});
github blueimp / nightwatch-browserstack / index.js View on Github external
updateStatus: function (browser, done) {
    if (browser.currentTest.results.failed || browser.currentTest.results.errors) {
      const caps = browser.options.desiredCapabilities
      const user = caps['browserstack.user']
      const key = caps['browserstack.key']
      const options = {
        host: 'www.browserstack.com',
        path: `/automate/sessions/${browser.browserStackSessionId}.json`,
        method: 'PUT',
        auth: `${user}:${key}`,
        headers: {'Content-Type': 'application/json'}
      }
      require('https')
        .request(options, function () { done() })
        .on('error', function (error) { throw error })
        .end(JSON.stringify({status: 'error'}))
    } else {
      done()
    }
  }
github nightwatchjs / nightwatch / lib / transport / browserstack.js View on Github external
get username() {
    return this.settings.desiredCapabilities['browserstack.user'];
  }
github axemclion / browser-perf / lib / options.js View on Github external
opts.browsers.forEach(function(browser) {
					browser['browserstack.user'] = opts.BROWSERSTACK_USERNAME;
					browser['browserstack.key'] = opts.BROWSERSTACK_KEY;
				});
				delete opts.BROWSERSTACK_USERNAME;