I wish to tag my BeforeFeature hooks in CucumberJS - Protractor tests such that
e.g. - Login as a particular user in BeforeFeature only for a feature file 'abc.feature'
The existing implementation of BeforeFeature in cucumberjs is as below -
this.registerHandler('BeforeFeature', function (feature) {
//do common action before feature file execution
});
I am not sure if it takes tags as arguments. Is there any other way to specify tags at BeforeFeature level?
this.BeforeFeature(function(feature) {
feature.getTags().forEach(function (tag) {
if(tag.getName() === '@myTag') {
//do common action before feature file execution
}
});
});
OR
this.BeforeFeature(function(feature) {
if(feature.getName() === 'ABC') {//Gherkin file => Feature: ABC
//do common action before feature file execution
}
});