0.1.0 • Published 10 years ago
rox-client-grunt-jasmine v0.1.0
rox-client-grunt-jasmine
Jasmine reporter to send test results to ROX Center from Grunt tasks.
This reporter can be used with Jasmine-based Grunt plugins like grunt-protractor-runner and grunt-contrib-jasmine. Only Jasmine 1.3 is supported at the moment.
Usage
This reporter must be used in conjunction with rox-client-grunt.
Add both as development dependencies:
npm install --save-dev rox-client-grunt
npm install --save-dev rox-client-grunt-jasmine
If you are using Protractor, add the reporter to your Protractor configuration:
// load the reporter module
var RoxReporter = require('rox-client-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 reporter to the jasmine environment
onPrepare: function() {
jasmine.getEnv().addReporter(new RoxReporter({
// custom rox client configuration
config: {
project: {
category: 'Protractor - Jasmine'
}
}
}));
}
};
If you are using grunt-protractor-runner, you must add the ROX grunt tasks around your test task. For example, in your Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
// rox grunt task configuration
roxGruntSetup: {
all: {}
},
roxGruntPublish: {
all: {}
},
// your protractor task configuration
// (note that the keepAlive option is required to work with the rox tasks)
protractor: {
options: {
configFile: 'test/protractor.conf.js',
keepAlive: true
},
all: {}
}
});
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('rox-client-grunt');
// add the rox grunt tasks around your task
grunt.registerTask('test-protractor', ['roxGruntSetup', 'protractor', 'roxGruntPublish']);
}
Requirements
- Node.js 0.10
- Jasmine 1.3
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
rox-client-grunt-jasmine is licensed under the MIT License. See LICENSE.txt for the full text.
0.1.0
10 years ago