Great to hear you made it work! 

I also managed to get the AngularJS-Protractor-Browserstack combo working 
with a simple setup. I basically followed Browserstack's instructions for 
setting up node.js (http://www.browserstack.com/automate/node).

First, I installed the seleniun web driver:

npm install -g browserstack-webdriver

I then set up my protractor conf.js file. Remember to change your user name 
and secret key to the ones given on the Browserstack Automate page. If 
you're logged in, the above instructions for node.js will have you user and 
key substituted in the examples, and you can just copy&paste the lines of 
code from there.

exports.config = {
  capabilities: {
    'browserstack.user' : 'my_user_name',
    'browserstack.key' : 'my_secret_key',

    // Needed for testing localhost
    'browserstack.local' : 'true',

    // Settings for the browser you want to test
    'browser' : 'Chrome',
    'browser_version' : '36.0',
    'os' : 'OS X',
    'os_version' : 'Mavericks',
    'resolution' : '1024x768'
  },
  
  // Browserstack's selenium server address
  seleniumAddress: 'http://hub.browserstack.com/wd/hub',

  // Pattern for finding spec files
  specs: ['test/**/*.spec.js']
}

After the setup, I downloaded the *BrowserStackLocal *binary.

I executed the binary in the console per the instructions (again, your key 
will be automatically substituted in the node.js guide, if you're logged in 
to Browserstack) to open the Browserstack tunnel:

./BrowserStackLocal *your_secret_key* localhost,3000,0

Change the port number to the port you're hosting your AngularJS files at 
on localhost, otherwise it won't work.

Everything ready, I ran my tests in the console with this command:

protractor protractor.conf.js

And everything worked! :)





On Tuesday, August 26, 2014 9:32:57 PM UTC+3, Charlie wrote:
>
> Success!  Ashwin Gonsalves over at BrowserStack got me headed in the right 
> direction.
> I needed to set baseURL and ensure my server was up and running before 
> calling the browserStackTunnel task.
>
> my conf file looks like:
>
> // An example configuration file.
>
> var bsConfig = {
>
>         'build': 'E2E Tests - ' + new Date().toISOString(),
>
>         'project': 'Media Relations',
>
>         'debug': true
>
>     };
>
>
> exports.config = {
>
>     // The address of a running selenium server.
>
>     seleniumAddress: 'http://hub.browserstack.com/wd/hub',
>
>     baseUrl: 'http://localhost:9000',
>
>     allScriptsTimeout: 55000,
>
>     // Capabilities to be passed to the webdriver instance.
>
>
>     multiCapabilities: [{
>
>             'browserName': 'firefox',
>
>             'os': 'Windows',
>
>             'build': bsConfig.build,
>
>             'project': bsConfig.project,
>
>             'browserstack.debug': bsConfig.debug,
>
>             'browserstack.tunnel': 'true',
>
>             'browserstack.user': process.env.BROWSER_STACK_USERNAME,
>
>             'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY
>
>         },
>
>         {
>
>             'browserName': 'IE',
>
>             'browser_version': '11.0',
>
>             'os': 'Windows',
>
>             'build': bsConfig.build,
>
>             'project': bsConfig.project,
>
>             'browserstack.debug': bsConfig.debug,
>
>             'browserstack.tunnel': 'true',
>
>             'browserstack.user': process.env.BROWSER_STACK_USERNAME,
>
>             'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY
>
>         },
>
>         {
>
>             'browserName': 'safari',
>
>             'os': 'OS X',
>
>             'build': bsConfig.build,
>
>             'project': bsConfig.project,
>
>             'browserstack.debug': bsConfig.debug,
>
>             'browserstack.tunnel': 'true',
>
>             'browserstack.user': process.env.BROWSER_STACK_USERNAME,
>
>             'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY
>
>         },
>
>         {
>
>             'browserName': 'chrome',
>
>             'os': 'Windows',
>
>             'build': bsConfig.build,
>
>             'project': bsConfig.project,
>
>             'browserstack.tunnel': bsConfig.debug,
>
>             'browserstack.user': process.env.BROWSER_STACK_USERNAME,
>
>             'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY
>
>         },
>
>         {
>
>             'browserName': 'chrome',
>
>             'os': 'OS X',
>
>             'os_version': 'Mountain Lion',
>
>             'build': bsConfig.build,
>
>             'project': bsConfig.project,
>
>             'browserstack.debug': bsConfig.debug,
>
>             'browserstack.tunnel': 'true',
>
>             'browserstack.user': process.env.BROWSER_STACK_USERNAME,
>
>             'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY
>
>         }],
>
>     // Spec patterns are relative to the current working directly when
>
>     // protractor is called.
>
>     specs: ['test/e2e/spec/admin/**/*.js'],
>
>
>     // Options to be passed to Jasmine-node.
>
>     jasmineNodeOpts: {
>
>         showColors: true,
>
>         defaultTimeoutInterval: 90000,
>
>         browserNoActivityTimeout: 50000,
>
>         captureTimeout: 60000
>
>     }
>
> };
> And my grunt tasks look like:
>
>     grunt.registerTask('Test-e2e-admin-browserstack', [
>         'sass:dev',
>         'clean:server',
>         'concurrent:server',
>         'connect:e2e',
>         'linkAssets-dev-admin',
>         'browserstackTunnel',
>         'protractor:admin_browserstack_target'
>     ]);
>
>         browserstackTunnel: {
>             options: {
>                 accessKey: process.env.BROWSER_STACK_ACCESS_KEY
>             },
>             development: {
>                 options: {
>                     hostname: 'localhost',
>                     port: 9000
>                 }
>             }
>         },
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to