Wrapper around the `behat` CLI tool.
npm install grunt-behat-wrapper* Build status
* Install
* Install with [npm](#install-with-npmnpmjsorg)
* Tasks
* behat-definitions
* behat-story-syntax
* behat-config-reference
* behat-run
* behat-rerun
* Configuration
* options.behatExecutable
* options.args
* options.args.suite
* options.args.format
* options.args.out
* options.args.formatSettings
* options.args.lang
* options.args.tags
* options.args.definitions
* options.args.appendSnippets
* options.args.noSnippets
* options.args.strict
* options.args.stopOnFailure
* options.args.profile
* options.args.config
* options.args.verbose
* options.args.noInteraction
* options.args.colors
* paths
* Flags
* Flag colors
* Flag no-colors
* Flag no-interaction
* Flag verbose
* Flag dryRun
* Flag strict
* Flag pretty
* Flag progress
* Examples
* Basic
* Author
* Release History
* License

``bash`
npm install grunt-behat-wrapper --save-dev
Wrapper around the behat --definitions foo command.
Print all available step definitions:
- use --definitions l to just list definition expressions.
- use --definitions i to show definitions with extended info.
- use --definitions 'needle' to find specific definitions.
Use --lang to see definitions in specific language.
Configuration
* options
* behatExecutable
* args
* definitions
* lang
With the default options the
`bash`
grunt behat-definitions
is equivalent to
`bash`
./bin/behat --definitions l
Wrapper around the behat --story-syntax command.
Print *.feature example.
Use --lang to see specific language.
Configuration
* options
* behatExecutable
* args
* lang
With the default options the
`bash`
grunt behat-story-syntax
is equivalent to
`bash`
./bin/behat --story-syntax
Wrapper around the behat --config-reference command.
Display the configuration reference.
Configuration
* options
* behatExecutable
With the default options the
`bash`
grunt behat-config-reference
is equivalent to
`bash`
./bin/behat --config-reference
Wrapper around the behat command.
Run tests.
Configuration
* options
* behatExecutable
* args
* suite
* format
* out
* formatSettings
* lang
* name
* tags
* role
* appendSnippets
* noSnippets
* strict
* stopOnFailure
* dry-run
* profile
* config
* verbose
* noInteraction
* colors
* paths
With the default options the
`bash`
grunt behat-run
is equivalent to
`bash`
./bin/behat
Wrapper around the behat --rerun command.
Re-run scenarios that failed during last execution.
Configuration
* options
* behatExecutable
With the default options the
`bash`
grunt behat-rerun
is equivalent to
`bash`
./bin/behat --rerun
Type: String
Default value: './bin/behat'
Path to behat executable.
Type: Object
Default value: {}
Key-value. The keys are almost the same as in the options in the CLI.
Type: String
Default value: null
Only execute a specific suite.
Type: String
Default value: null
How to format tests output. pretty is default.
Available formats are:
* progress: Prints one character per step.
* pretty: Prints the feature as is.
You can use multiple formats at the same time. (multiple values allowed)
Type: String
Default value: null
Write format output to a file/directory instead of STDOUT (output_path).
You can also provide different outputs to multiple formats. (multiple values
allowed)
Type: String
Default value: null
@todo Set formatters parameters using json object. Keys are parameter names,
values are values. (multiple values allowed)
Type: String
Default value: null
Only executeCall the feature elements which match part of the given name or
regex. (multiple values allowed)
Type: String
Default value: null
Only executeCall the features or scenarios with tags matching tag filter
expression. (multiple values allowed)
Type: String
Default value: 'l'
Type: Boolean
Default value: false
Appends snippets for undefined steps into main context.
Type: Boolean
Default value: false
Do not print snippets for undefined steps after stats.
Type: Boolean
Default value: true
Passes only if all tests are explicitly passing.
Type: Boolean
Default value: true
Stop processing on first failed scenario.
Type: String
Default value: null
Specify config profile to use.
Type: String
Default value: null
Specify config file to use.
Type: Boolean
Default value: false
Type: Boolean
Default value: false
Do not ask any interactive question.
Type: TriState
Default value: null
If true then force ANSI color in the output. By default color support is
guessed based on your platform and the output if not specified.
If false then force no ANSI color in the output.
Type: String[]
Default value: []
Optional path(s) to execute. Could be:
* a dir (features/)
a feature (.feature)
a scenario at specific line (.feature:10).
all scenarios at or after a specific line (.feature:10-*).
all scenarios at a line within a specific range (.feature:10-20).
a scenarios list file (.scenarios).
You can modify the arguments by Flags
Override the value of options.args.colors argument with true.
Override the value of options.args.colors argument with false.
Override the value of options.args.noInteraction argument with true.
Override the value of options.args.verbose argument with true.
Override the value of options.args.dryRun argument with true.
Override the value of options.args.strict argument with true.
Override the value of options.args.format argument with 'pretty'.
Override the value of options.args.format argument with 'progress'.
`javascript
require('jit-grunt')(
grunt,
// Mapping.
{
'behat-definitions': 'grunt-behat-wrapper',
'behat-story-syntax': 'grunt-behat-wrapper',
'behat-config-reference': 'grunt-behat-wrapper',
'behat-run': 'grunt-behat-wrapper',
'behat-rerun': 'grunt-behat-wrapper'
}
);
grunt.config.init({
'behat-definitions': {
main: {}
},
'behat-story-syntax': {
main: {}
},
'behat-config-reference': {
main: {}
},
'behat-run': {
main: {}
},
'behat-rerun': {
main: {}
}
});
``
Andor Dávid
* GitHub
* Twitter
* LinkedIn
* v0.0.2 - 2015-06-28
* Add dynamic flag support for --lang, --definitions and --profile.
* Fix "files" vs "paths" documentation bug.
* v0.0.1 - 2015-06-27
* Initial release with basic functions.
Copyright (c) 2015 Andor Dávid, contributors.