I do not think you can. In AfterFeatures, the cucumber process has already been completed, so this one no longer refers to it.
, , AfterFeatures. AngularJS + Protractor, Protractor , hook AfterFeatures. . .
hooks.js
var myHooks = function () {
this.registerHandler('AfterFeatures', function (event, callback) {
console.log('----- AfterFeatures hook');
browser.get('/quit').then(callback);
});
};
module.exports = myHooks;
world.js
module.exports = function() {
this.World = function World(callback) {
this.visit = function(url) {
console.log('visit ' + url);
return browser.get(url);
};
callback();
};
}
AfterFeatures cucumber-js GitHub , , , . -js, .
, registerHandler.
this.AfterFeatures(function (event, callback) {
browser.get('/quit').then(callback);
});
, .