bencompton / jest-cucumber

Execute Gherkin scenarios in Jest
Apache License 2.0
660 stars 118 forks source link

AutoBindSteps - Tag filtering happens after steps validation #94

Open Geloloboy opened 4 years ago

Geloloboy commented 4 years ago

It seems that you are unable to filter scenarios using the tags unless all steps have definitions.

As a background, I'm trying to have all feature files inside a single folder and having the capability to run either UI or Integration test whichever suits the scenario best. I'm using webdriverio for UI and jest-cucumber for integration.

With this error, I'm unable to run my jest-cucumber tests without running into step definition problems. Webdriverio supports this on the other hand.

bencompton commented 4 years ago

I actually use it this way in my own project. I have Jest Cucumber tests running only scenarios tagged as @ui, and SpecFlow running scenarios with C# step definitions tagged with @api. This works as expected for me in my project using the latest version of this package. This issue is over a month old, so perhaps you got it working by now, or moved onto something else, but it would help if you could post steps to reproduce if you're still having problems.

This is what my global Jest Cucumber configuration looks like:

const setJestCucumberConfiguration = require('jest-cucumber').setJestCucumberConfiguration;

setJestCucumberConfiguration({
    tagFilter: '@ui'
});
angeloderivco commented 3 years ago

This functionality works if you have a steps file for the feature but not when you use it with autoBindSteps.

I'll put in some code to replicate this when i get the time but hopefully this would suffice for you.