Search code examples
gruntjssaucelabsdalekjs

Running Dalekjs Tests on Saucelabs with Grunt


what i want:

run dalekjs-tests on saucelabs with grunt

what i did:

  1. installed grunt-dalek, dalek-driver-sauce

  2. created grunt config:

         dalek: {
           options: {
             driver: ['sauce'],
             browser: ['chrome'],
             advanced: {
               "driver.sauce": {
                 user: "xxx",
                 key: "xxx"
               }
             }
           }
         }
    

what my problem is

Warning: Cannot read property '0' of null Use --force to continue.

Solution

  • finally i had some time to dig deeper into this. the error came from dalek-driver-sauce.

    Function _verfiyBrowserConfig inside browser.js caused the problem.

    var browser = browsers[0][browserName] || null;
    

    in my config i was missing the browsers property.

    the dalek-driver-sauce docs are kind of misleading there:

    if you would like to have a more control over the browser/OS combinations that are available, you are able to configure you custom combinations

    the browsers config inside advanced-config is mandatory!

    a final working grunt-config looked like this:

    dalek: {
      options: {
        driver: ['sauce'],
        advanced: {
          "driver.sauce": {
            user: "xxx",
            key: "xxx"
          },
          browsers: [{
            chrome: {
              "platform": "OS X 10.6",
              "actAs": "chrome",
              "version": 27
            }
          }]
        }
      },
      mytest: ['test.js']
    }