1
votes

I use protractor to test my angular app. When I manually launch protractor it works properly and tests everything but the trouble comes when I try to launch it through grunt.

When I launch my grunt task for testing, protractor finds the conf file (it displays the right number of specs to test) but just open the chrome driver for less than a seconds on a weird "data;" url, close it right away and marks all the tests as "passed".

Here is my gruntfile.js for protractor:

 protractor: {
  options: {
    configFile: "e2e-tests/protractor.conf.js", // Default config file
    keepAlive: false, // If false, the grunt process stops when the test fails.
    noColor: false, // If true, protractor will not use colors in its output.
    args: {
      verbose: true,
    }
  },
  all: {}
}

and my protractor conf file:

 exports.config = {
  allScriptsTimeout: 11000,

  seleniumAddress: 'http://localhost:4444/wd/hub',

  specs: [
    '*.js'
  ],

  capabilities: {
    'browserName': 'chrome'
  },

  baseUrl: 'http://localhost:8000/',

  framework: 'jasmine',

  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

Again, if I manually launch protractor on the same conf file it works (even if I use the local protractor in the local node_modules directory) I really don't understand what's going on.

Thanks a lot guys !

1

1 Answers

1
votes

Found the solution. It seems that grunt-protractor-runner needed node >= 4.2.0 and I was running 4.1.x . Couldn't found any log pointing to that though.