-
Notifications
You must be signed in to change notification settings - Fork 46
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
Migration from Specflow - using undocumented feature #155
Comments
Have you used that from a hook? If yes, which one? |
not just from ValueRetriever without any bindings or using from hook |
For MsTest the short answer is that you can use The longer answer: If you don't run your tests parallel, you can still use For parallel execution cases, it is not possible to guess in general that your ValueRetriever is called from the same thread as your scenario, so this is not generally possible. (Depends on the runner and if you use async or not.) We plan to make an improvement on assist methods so that they are bound to the scenario context. See https://github.com/orgs/reqnroll/discussions/16. What you can do as a temporary solution is to make a before scenario hook and save the scenario context to a thread local field until the mentioned feature will be ready. This will work in non-async parallel execution cases as well. Does that help? |
Thanks, I will try it next week(if I will have enough time) and inform you |
I close this issue for now, but please feel free to reopen if there are any updates. |
I could not implement your suggestion quickly, so I decided not to spend time on it (because it is a temporary solution) and wait until the ticket https://github.com/orgs/reqnroll/discussions/16 is done. |
Reqnroll Version
2.0
Which test runner are you using?
MSTest
Test Runner Version Number
3.2.2
.NET Implementation
.NET 8.0
Test Execution Method
Visual Studio Test Explorer
Content of reqnroll.json configuration file
It is not being used
Issue Description
In Specflow I could make such a call to receive injected context without using [Binding] attribute
In Reqnroll I could use
but ScenarioContext is always null and I do not know where I could take workerId for the current run
Is there any way to reuse Specflow approach
I need this in my custom IValueRetriever class
Steps to Reproduce
just run existing test
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered: