Skip to content
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

Can we have an @retry attribute? #140

Open
alastair-todd opened this issue Jan 10, 2023 · 8 comments
Open

Can we have an @retry attribute? #140

alastair-todd opened this issue Jan 10, 2023 · 8 comments

Comments

@alastair-todd
Copy link

Someone has made one for Specflow: https://github.com/giggio/xunit-retry

Would be really useful

@ttutisani
Copy link
Owner

I could think why it is helpful with the code in the feature class, but what's the point of it in Gherkin text? Why would somebody write a specification in Gherkin and care about retry?

@alastair-todd
Copy link
Author

Non-atomic 3rd party updates providing false-flag assertions e.g. AWS Cognito - Create

I just want to rerun the whole scenario easily a few times without worrying about trying to code for it

@ttutisani
Copy link
Owner

ttutisani commented Jan 10, 2023

Your answer again explains why it's helpful in code, but it does not explain why it's helpful in Gherkin.

My point was that Gherkin is typically a human-readable specification. A person who writes Gherkin should not be thinking about retries, but instead, they think about functionality, business language, etc. On the other hand, Retry is a technical term, so I don't see much value in supporting a 'retry' attribute in Gherkin. In code, yes, I agree, it may have value.

@alastair-todd
Copy link
Author

I hear what you are saying. For us there's no collaboration on the actual code files so business folk would never see it. I'd take practicality over ideology any day :)

That said if you can see a way of rerunning a scenario from the class that would be practical too.

@ttutisani
Copy link
Owner

Yes, from the code, it will have to be an attribute like this.

I assume it will retry if an error is encountered. Otherwise, just one execution.

@alastair-todd
Copy link
Author

On failed assertion rather than runtime error I think no?

@ttutisani
Copy link
Owner

I would say both cases and valid, so it can be configurable. The attribute could take a base exception type as an argument/parameter and default to AssertException (if I'm typing the name correctly). That would be more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants