Grunt plugin for Kobold
Table of Contents
##Installation
Install this module with the following command:
npm install grunt-kobold
Add the module to your package.json
dependencies:
npm install --save grunt-kobold
Add the module to your package.json
dev-dependencies:
npm install --save-dev grunt-kobold
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-kobold');
In your project's Gruntfile, add a section named kobold
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
kobold: {
your_target: {
// Target-specific Kobold options go here.
},
},
})
Type: Object
--optional--
Options that would be otherwise in the global config file. You can also require the js or json file instead of adding here all the configurations.
Type: String[]
--optional--
List of Mocha arguments that will be passed-through.
Type: String
--optional-- (default: 'approved')
Name of the approved folder where Images are defined as approved and how the build images should look like. This can also be the path to a folder.
Type: String
--optional-- (default: 'build')
Name of the build folder that holds the most recent build images, taken to be compared to the approved images. This can also be the path to a folder.
Type: String
--optional-- (default: 'highlight')
Name of the highlight folder that will be used as the result folder, showing all the differences found during visual regression tests. This can also be the path to a folder.
Type: String
--optional-- (default: 'config')
Name of the config folder that describes image specific configurations the overwrite global configuration options that were given with the config
property above. This can also be the path to a folder.
Type: Boolean
--optional-- (default: false)
Defines if a test should fail when a previously approved images is missing from the current build images. This might happen if not all the screenshots could be taken due to an error, or it might simply be removed from the test-cases.
Type: Boolean
--optional-- (default: false)
Defines if a test should fail when a previously unseen image appears in the build images. You might want to fail these tests to manually approve them; if they are not approved, then they will never be really compared.
Type: String
--optional-- (default: current working directory)
Path to directory holding all the test-folders (i.e. approved
, build
, highlight
, and config
).
You can supply the configuration in the options object of a task:
grunt.initConfig({
kobold: {
ci: {
options: {
config: require('./config.js')
}
}
}
})
You can supply the configuration inline in the options object of a task:
grunt.initConfig({
kobold: {
ci: {
options: {
config: {
"outputBackgroundGreen": 255
}
}
}
}
})
Here another example, but with more options:
grunt.initConfig({
kobold: {
ci: {
options: {
config: {
"outputBackgroundGreen": 255
},
highlightFolder: "result",
failOrphans: true,
failAdditions: true
}
}
}
})
##Third-party libraries
The following third-party libraries are used by this module:
###Dependencies
###Dev-Dependencies
- grunt: http://gruntjs.com
- chai: http://chaijs.com
- codeclimate-test-reporter: https://github.com/codeclimate/javascript-test-reporter
- coveralls: https://github.com/cainus/node-coveralls
- istanbul: https://github.com/gotwarlost/istanbul
- mocha: https://github.com/visionmedia/mocha
- sinon: http://sinonjs.org
- sinon-chai: https://github.com/domenic/sinon-chai
- yuidocjs: https://github.com/yui/yuidoc
##License
The MIT License
Copyright 2015 Marcel Erz