Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add step hooks #162

Closed
jmaxxz opened this issue Mar 17, 2014 · 4 comments
Closed

Add step hooks #162

jmaxxz opened this issue Mar 17, 2014 · 4 comments

Comments

@jmaxxz
Copy link

jmaxxz commented Mar 17, 2014

I am trying to port a test suite from specflow to cucumber.js, and have found the hooking of steps very useful for snapshotting state changes which take place in the when block. This would be a really nice feature to have in cucumber.js.

https://github.com/techtalk/SpecFlow/wiki/Hooks

Cucumber has this feature as well:
https://github.com/cucumber/cucumber/wiki/Hooks

@jbpros
Copy link
Member

jbpros commented Mar 17, 2014

It's not documented (yet) but available:

module.exports = function () {
  this.BeforeStep(function (step, callback) {
    console.log(step);
    callback();
  });
};

See https://github.com/cucumber/cucumber-js/blob/master/lib/cucumber/listener/events.js for a list of all available hooks.

@jbpros jbpros closed this as completed Mar 17, 2014
@jmaxxz
Copy link
Author

jmaxxz commented Mar 25, 2014

TY kind sir!

@tunovic
Copy link

tunovic commented May 18, 2018

Does this still work? I also see this issue #997

@lock
Copy link

lock bot commented May 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants