2

I'm on OSX, and have a grunt watch file with jshint & protractor tests. I get growl notifications from the jshint messages, but none from protractor failures. I would prefer to get a visible popup notification rather than having to inspect the terminal output.

Any suggestions?

The packages used are:

grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-http-server' );
grunt.loadNpmTasks( 'grunt-protractor-webdriver' );
grunt.loadNpmTasks( 'grunt-protractor-runner' );
grunt.loadNpmTasks( 'grunt-notify' );

grunt.task.run( 'http-server:test' );
grunt.task.run( 'protractor_webdriver:test' );
grunt.task.run( 'notify_hooks' );
peterorum
  • 1,401
  • 2
  • 15
  • 21
  • 1
    Have you tried configuring `grunt-notify` to work with it? Maybe using a custom task config? Or `grunt-protractor`? – markthethomas Dec 13 '14 at 07:36
  • I had grunt-notify & grunt-protractor-runner installed. It seems the key is to set the protractor keepAlive option to false so that it exits on failure, which causes a growl notification. – peterorum Dec 13 '14 at 12:12
  • So that worked then? Great. BTW: in the future you'll want to post your whole gruntfile or at least the areas that relate to the tasks in question, since based on your code we can't know what you've tried and not tried :) – markthethomas Dec 13 '14 at 15:18

2 Answers2

0

This is possible with some minor setup. You need to enable growl in your protractor setup.

mochaOpts: {
  reporter: "spec",
  slow: 3000,
  growl: true
}

And make sure growl is enabled in your setup

67hz
  • 381
  • 3
  • 7
0

There is a plugin for this

npm install --save-dev protractor-notify-plugin

You can add to your protractor.conf.js file in the plugins section

plugins: [{
    package: 'protractor-notify-plugin',
    notifier: 'growl'
}]

Maybe check it out here https://github.com/el-davo/protractor-notify-plugin

el-davo
  • 223
  • 6
  • 10