2

I am implementing BeforeFeature hook and I want to know which feature I am in

    var hooks = function () {
        this.registerHandler('BeforeFeature', function (event, callback) {
        console.log(event.feature ????)
    });
};

When I debug, on the console, event.feature is undefined. I can do event.getName(), then obviously I get "BeforeFeature" as result. Anyone knows how I can get the feature that it's going to evaluate? Thanks.

4

1 回答 1

3

我终于得到了功能名称:

event.getPayloadItem('feature').getName()

对于场景、步骤等也是如此。

https://github.com/cucumber/cucumber-js/issues/200

于 2014-12-03T16:39:56.797 回答