-
Notifications
You must be signed in to change notification settings - Fork 754
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
WIP. xUnit Collection name and Collection fixture class full name tags #1430 #1833
base: master
Are you sure you want to change the base?
Conversation
#686 (comment) collection name was limited to alpha,numeric, _- for the purpose, because tag names has this limit. I am trying to find out why tags originally has such limitation |
Sorry that I come so late to this PR. We were a little bit preoccupied in the last weeks with other stuff (https://specflow.org/2020/tricentis-acquires-specflow/). Thanks for the PR! What I would like to see is a better scenario to test the functionality. |
Hey guys, I'm seeing the same issue #1430, two instances are created and the second time it doesn't call the I'm trying to start async a docker container in this method, and the second time it passes by the constructor of my fixture it recreates my container instance, but doesn't call the Do you guys have any plans for this fix? Or do you know any workarounds for this? Thanks in advance :) |
@jdelucaa Yes a workaround for this is to avoid injecting the fixture in the step constructor and initialize a static property (Singleton-ish hack) and then from your binding classes you can access the collection fixture via this static property. You need also to use the @xunit:collection() tag in your feature files in order for this hack to work `public class TestAppFixture : IAsyncLifetime
|
Hi |
Any plans on fixing this issue? |
Hi, I need this too. |
Namaste!
I tried to solve #1430. But because I can't build NuGet-package and run tests locally I can't validate my work. I'm very new to BDD and SpecFlow. So what I tried to accomplish:
@xunit:collection
tag is broken. The problem was collection name could be any string not just a valid identifier. I've fixed that. Now I require that tag should be in a form (note the quotes):CollectionAttribute
on a text class to make it parallelizable or not. If there is noCollectionAttribute
on a class it has a virtual one by default, every class is a separate collection.@xunit:collectionFixtureClassFullName
. Yes it's a bit long but at least self describing. The value of this tag is the full class name of a test collection fixture. I tried to use collection class full name (because collection class has it's name in the attribute and collection fixture class name in type declaration) but realized that I have no access to actual user code during code generation pass. The best user can specify is the collection fixture class full name. Usage (once again quotes are required):The class name can contain any word characters not only Latin. Please don't forget about other languages and cultures. They are and .NET allows to use those characters for valid literals.
4. Collection name and Collection fixture class full name tags are mutually exclusive. The user should one or another or non at all.
Thank you for your attention and I'm ready to discuss the change.
Types of changes
Checklist: