Skip to content

Instantly share code, notes, and snippets.

@sankargorthi
Created October 19, 2012 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sankargorthi/3916558 to your computer and use it in GitHub Desktop.
Save sankargorthi/3916558 to your computer and use it in GitHub Desktop.
support/hooks.js
var hooks = function() {
var browser = require("browser.js");
this.Before(function(callback) {
console.log('hello');
callback();
});
this.After(function(callback) {
console.log('test complete');
callback();
});
};
module.exports = hooks;
@jbpros
Copy link

jbpros commented Oct 19, 2012

Looks good. Where do you put that file and how do you invoke Cucumber?

@sankargorthi
Copy link
Author

This file goes under
features
|
-----support
|---------- world.js
|---------- hooks.js
-----step_definitions
|---------- <step_definitions files>

I was trying to write a batch/shell script that would take an argument to look something like this:

./test.sh features/folder/specific_feature.feature

and that would take care of requiring all the step_definitions and support files. So, the script uses a --require to load the step_definitions. Is this the right way to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment