0

Edit: This has since been solved as an interesting network issue, see my comments and answer below.

Original Post:

My goal: Setup proof-of-concept tests on BrowserStack with Intern.

I went through the intern-tutorial, which all worked beutifully for me on Sauce Labs, and now I just want to learn what it takes to modify that configuration to test on BrowserStack, which keeps failing for me.

The terminal command, as per the tutorial:

./node_modules/.bin/intern-runner config=tests/intern

When running that, I get:

Listening on 0.0.0.0:9000
Starting tunnel...
BrowserStackLocal v2.2
Connecting to BrowserStack using WebSocket protocol...
Connected.
Ready
Error: connect ETIMEDOUT
  at errnoException  <net.js:904:11>
  at Object.afterConnect [as oncomplete]  <net.js:895:19>

TOTAL: tested 0 platforms, 0/0 tests failed; fatal error occurred

Environment:
OS: Mac OS X 10.9.4
Node: 0.10.29
NPM: 1.4.21
Intern: 2.0.1

Variables set in ~/.bash_profile as:

export BROWSERSTACK_USERNAME="<my_actual_username>"
export BROWSERSTACK_ACCESS_KEY="<my_actual_access_key>"

Intern configuration set in tests/intern as:

define({
    proxyPort: 9000,
    proxyUrl: 'http://localhost:9000/',

    capabilities: {
        'selenium-version': '2.41.0'
    },

    environments: [
        { os: "Windows", os_version: "8.1", browser: "chrome", browser_version: "34.0" }
    ],

    maxConcurrency: 3,

    tunnel: 'BrowserStackTunnel',
    tunnelOptions: {
        verbose: true
    },

    loader: {
        packages: [ { name: 'app', location: 'app' } ]
    },

    suites: [ 'tests/hello' ],

    functionalSuites: [ 'tests/functional/index' ],

    excludeInstrumentation: /^(?:tests|node_modules)\//
});

As in, this is all that has been changed since the completed tutorial:

  • Removed all but one environment object (for simplicity), modified it to a format supported by BrowserStack.
  • Set the 'tunnel' property to the appropriate tunnel class.
  • Set tunnelOptions: { verbose: true } for debugging.

Things I've tried:

My environment object should be valid, as its based on one coming back from:
https://www.browserstack.com/automate/browsers.json

I feel like there's some basic thing here I'm missing about the configuration.

Community
  • 1
  • 1
Seth Holladay
  • 8,951
  • 3
  • 34
  • 43
  • Could you please install longjohn and identify where that horrible error is coming from so we can make it less useless? Thanks :) – C Snover Jul 28 '14 at 05:17
  • @CSnover, I'm now pretty confident this is a WebSocket issue. Here is my output with longjohn: http://pastebin.com/Cd4cQeCp – Seth Holladay Jul 29 '14 at 01:08
  • It has been reported (in unrelated applications), that WebSocket - which BrowserStack is trying to use here - is blocked on many mobile networks. And I happen to use a Verizon Jetpack for WiFi. See example a few posts down here: http://socketio4net.codeplex.com/discussions/458768 – Seth Holladay Jul 29 '14 at 01:26

2 Answers2

2

Can you have a look into the intern config file, which I use to run tests on browserstack. Hope it will help you solve your problem.

Akshay
  • 106
  • 1
  • 5
0

I have confirmed via A/B testing on different networks and with the same configuration, that this is due to the fact that Verizon Wireless blocks WebSocket connections, which has been reported elsewhere (see my comments on the original question).

This can be very tricky to diagnose. I hope it helps someone in the future!

Seth Holladay
  • 8,951
  • 3
  • 34
  • 43