-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep setDefinitionFunctionWrapper
around
#1772
Comments
Taking a look at your code reference, there appears to be a few different things.
Are there other things you are accomplishing with the step definition wrapper or are there other items? Also, at a high level, how is your library using cucumber? Instead of locking ourselves to the features that existed before (for a much different reason), I think it'd be nicer to start fresh to see what problem you are trying to solve and see if we can agree on a feature set that makes sense for cucumber-js and your library |
Thanks @charlierudolph for responding!
Not really. Happy to have users use the standard way of retrying. Can you reference some docs around this?
Can I register these hooks when initialising the framework? WebdriverIO has their own
We use Cucumber programatically to allow running it within the WebdriverIO framework. The challenge we have is to make sure our reporting framework works with the one Cucumber has (which is why we have our own eventListener as well as ensure that WebdriverIO services work (which is why we register things like Actually after revisiting this it appears that the reason we need |
Retry docs are here https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md - let me know if anything unclear With |
@davidjgoss |
Node 14 LTS ends in April 2023. Could you have the version of your code that wraps the definitions just rely on the old version of cucumber or is there something that you need from the latest version of cucumber? Also if you need to wrap user provided functions that are certainly other ways to do it, although they certainly wouldn't be as nice as the previous API (could create wrapped step definitions functions or provide a helper to users to wrap their own functions). Does your library require the functions to be wrapped or is that just the suggested? (ie you could use async/await instead of synchronous execution. |
I haven't had anyone asking to update Cucumber to get access to a specific feature. We however regularly update versions so it is hard to answer the question.
And it would be a breaking change that would cause many people to not update.
WebdriverIO provides sync and async execution. Many people coming from other languages like Java or Python preferred synchronous execution and have written their step definitions this way. As we are not able to continue support for sync execution we are working on helping the user base to transition to What would be the harm of Cucumber to keep the method around? I am fine if it is undocumented and even marked as deprecated. |
Closing as this was added back in #1795 - thanks for the feedback! |
Thanks for considering to keep it, much appreciated. |
Is your feature request related to a problem? Please describe.
I am currently trying to update Cucumber within WebdriverIO to the latest version and saw that
setDefinitionFunctionWrapper
is marked as deprecated. I would vote for keeping it around (doesn't need to be publicly documented) so WebdriverIO can make use of it.The reason we need to wrap the step definition is because we have our own custom hooks around steps and hooks. We use that for our retry mechanisms and other things.
Describe the solution you'd like
It would be amazing to keep it around as we can't just insert a Cucumber hook to achieve this. It doesn't need to be publicly documented.
Describe alternatives you've considered
I am not sure if there is any other way to wrap individual steps and hook in Cucumber. If there is one, please let me know.
Additional context
Here is the part where we wrap things: https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-cucumber-framework/src/index.ts#L296-L322
The text was updated successfully, but these errors were encountered: