How to use the browserstack.key 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 browserstack / cucumber-js-browserstack / features / support / hooks.js View on Github external
this.Before(function (scenario, callback) {
    var world = this;
    var task_id = parseInt(process.env.TASK_ID || 0);
    var caps = config.capabilities[task_id];
    caps['browserstack.user'] = username;
    caps['browserstack.key'] = accessKey;

    if(caps["browserstack.local"]){
      // Code to start browserstack local before start of test and stop browserstack local after end of test
      bs_local = new browserstack.Local();
      bs_local.start({'key': accessKey }, function(error) {
        if (error) return console.log(error.red);

        world.driver = createBrowserStackSession(config, caps);
        callback();
      });
    }
    else {
      world.driver = createBrowserStackSession(config, caps);
      callback();
    }
  });
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 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) {
        capabilities.cucumberOpts.tags = tags;
github cloudfoundry / stratos / src / test-e2e / browserstack-helper.js View on Github external
return new Promise(function (resolve, reject) {
        exports.bs_local = new browserstack.Local();
        exports.bs_local.start({'key': config.capabilities['browserstack.key'] }, function (error) {
          if (error) return reject(error);
          console.log('BrowserStack Connected. Now testing...');

          psnode.lookup({command: 'BrowserStackLocal'}, function (err, list) {
            exports.bs_local_processes = list;
            resolve();
          });
          });
      })
    };
github style-tools / async / test / specs / browserstack-tests.js View on Github external
before(function(done) {

                        bsLocal = new browserstack.Local();

                        bsLocal.start({
                            'key': caps['browserstack.key']
                        }, function(error) {
                            if (error) done(error);

                            driver = buildDriver(caps);
                            done();
                        });
                    });
github browserstack / nightwatch-browserstack / scripts / local.globals.js View on Github external
beforeEach : function(browser, done) {
    console.log("Connecting local");
    bs_local = new browserstack.Local();
    bs_local.start({'key': browser.options.desiredCapabilities['browserstack.key'] }, function(error) {
      if (error) return done(error);

      console.log('Connected. Now testing...');
      done();
    });
  },
github nightwatchjs / nightwatch / lib / transport / browserstack.js View on Github external
get accessKey() {
    return this.settings.desiredCapabilities['browserstack.key'];
  }
github infor-design / enterprise / protractor.browserstack.conf.js View on Github external
return new Promise((resolve, reject) => {
      exports.bs_local = new browserstack.Local();
      exports.bs_local.start({'key': exports.config.commonCapabilities['browserstack.key'] }, (error) => {
        if (error) {
          return reject(error);
        };
        resolve();
      });
    });
  },
github nightwatchjs / nightwatch / lib / transport / browserstack.js View on Github external
adaptSettings() {
    this.settings.webdriver.start_process = false;
    this.settings.webdriver.port = Number(this.settings.webdriver.port);
    if (this.settings.webdriver.port === 443) {
      this.settings.webdriver.ssl = true;
    }

    if (!this.accessKey && process.env.BROWSERSTACK_KEY) {
      this.settings.desiredCapabilities['browserstack.key'] = process.env.BROWSERSTACK_KEY;
    }

    if (!this.username && process.env.BROWSERSTACK_USER) {
      this.settings.desiredCapabilities['browserstack.user'] = process.env.BROWSERSTACK_USER;
    }

    if (!this.build) {
      this.settings.desiredCapabilities.build = 'nightwatch-test-build';
    }
  }