Jasmine (with Grunt.js) probe for Probe Dock.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Gruntfile.js
LICENSE.txt
README.md
index.js
package.json

README.md

Jasmine (Grunt.js) Probe for Probe Dock

Jasmine reporter to publish test results to Probe Dock with Grunt.js.

NPM version Dependency Status License

This reporter can be used with Jasmine-based Grunt plugins like grunt-protractor-runner. Only Jasmine 1.3 is supported at the moment.

Remark: The Jasmine-based grunt plugins must let you the possibility to add a custom reporter provided by this probe.

Requirements

  • Node.js 0.10+
  • Jasmine 1.3

Installation

Install it as a development dependency along with probedock-grunt:

npm install --save-dev probedock-grunt
npm install --save-dev probedock-grunt-jasmine

If you haven't done so already, set up your Probe Dock configuration file(s). This procedure is described here:

Setup with Protractor

For Protractor, add the reporter to your Protractor configuration:

// Load the Probe Dock reporter.
var ProbeDockReporter = require('probedock-grunt-jasmine');

exports.config = {
  allScriptsTimeout: 11000,

  specs: [
    'e2e/**/*.js'
  ],

  capabilities: {
    'browserName': 'firefox'
  },

  baseUrl: 'http://example.com',

  // The jasmine framework is required.
  framework: 'jasmine',

  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  },

  // Add the Probe Dock reporter to the jasmine environment.
  onPrepare: function() {
    jasmine.getEnv().addReporter(new ProbeDockReporter({

      // custom Probe Dock configuration
      config: {
        project: {
          category: 'Protractor'
        }
      }
    }));
  }
};

Then you also need to add the Probe Dock grunt tasks around your grunt-protractor-runner test task.

For example, in your Gruntfile:

module.exports = function(grunt) {

  grunt.initConfig({

    // Probe Dock grunt task configuration
    probedockSetup: {
      all: {}
    },

    probedockPublish: {
      all: {}
    },

    // your protractor task configuration
    // (note that the keepAlive option is required to use the Probe Dock tasks)
    protractor: {
      options: {
        configFile: 'test/protractor.conf.js',
        keepAlive: true
      },
      all: {}
    }
  });

  grunt.loadNpmTasks('grunt-protractor-runner');
  grunt.loadNpmTasks('probedock-grunt');

  // add the Probe Dock grunt tasks around your task
  grunt.registerTask('test-protractor', ['probedockSetup', 'protractor', 'probedockPublish']);
}

Usage

To track a test with a Probe Dock test key, add this annotation to the test name:

describe("something", function() {
  it("should work @probedock(abcd)", function() {
    expect(true).toBe(true);
  });
});

You may also define a category, tags and tickets for a test like this:

describe("something", function() {
  it("should work @probedock(key=bcde category=Integration tag=user-registration tag=validation ticket=JIRA-1000 ticket=JIRA-1012)", function() {
    expect(true).not.toBe(false);
  });
});

Contributing

  • Fork
  • Create a topic branch - git checkout -b feature
  • Push to your branch - git push origin feature
  • Create a pull request from your branch

Please add a changelog entry with your name for new features and bug fixes.

License

probedock-grunt-jasmine is licensed under the MIT License.