cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.02k stars 1.09k forks source link

Be able to run the tests with undefined steps and not fail. #2312

Closed jfstephe closed 11 months ago

jfstephe commented 11 months ago

🤔 What's the problem you're trying to solve?

I have features that are used for manual and automated tests, with @manual tags for the manual tests. I want my build to run all the automated tests, but produce a json output that also includes by manual tests. ATM I have to run my tests twice, once for the 'full' test report (I don't fail the build on this), and once with the 'real' test run which will fail the build if any non-manual tests error.

✨ What's your proposed solution?

(FYI I've read https://github.com/cucumber/cucumber-js/issues/867)

ATM there is the --no-strict option but it doesn't allow undefined steps. It's still a little bit strict :-).

Assuming the proposal in 867 was implemented as suggested: Strict mode - succeeds if and only if every step has status passed/skipped Non-strict mode - succeeds if and only if every step has status passed/skipped/pending

Then something like the following would allow the manual test 'failures' to be recorded as passed/skipped/pending/undefined but would not cause a non-zero error code from cucumber --never-fail-with: "@manual"

⛏ Have you considered any alternatives or workarounds?

Yes. Running the build twice is a bit rubbish! :-)

📚 Any additional context?

No


This text was originally generated from a template, then edited by hand. You can modify the template here.

davidjgoss commented 11 months ago

This isn't something we'll support as an option I'm afraid - pending ties to a specific development workflow, but undefined or ambiguous steps are always considered a failure and that won't change.

You might be able to achieve something close to what you want be doing a separate dry run for your non-automated feature to generate a JSON output you can work with. Ultimately though Cucumber is for running automated tests - if you want to produce reporting for non-automated feature files, that would be best served by a different tool.