-
Notifications
You must be signed in to change notification settings - Fork 5
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
Problem matching steps in the editor #38
Comments
To simplify the things, for example the two step defs are marked as ambiguous (although they work fine as test):
Questions:
It is really strange that it works differently in VS and in test execution, because VS should ask from the runtime what regex the cucumber expression is translated to, so the two should use the same regex at the end... But let's see. |
HiThanks for getting back to me. To answer the questions :1. It doesn’t matter what is in an enum.2. I have not defined an argument transformation. It didn’t seem necessary. We have a lot of tests with choices, and using an enum seems to be the only way to do that in a Cucumber Expression. It would make things rather overcomplicated to also require an argument transformation. I’ll give it a try though. It does seem like the editor is using (.*) instead of (value1|value2) though CheersJimOn 19 Sep 2024, at 7:52 AM, Gáspár Nagy ***@***.***> wrote:
To simplify the things, for example the two step defs are marked as ambiguous (although they work fine as test):
[Then("the batch with ID {int} should {BeDeletedOrNot}")]
[Then("the batch with ID {int} should be updated")]
Questions:
What are the values in the BeDeletedOrNot enom (or it does not matter)?
Do you have a [StepArgumentTransformation] defined for the enums?
It is really strange that it works differently in VS and in test execution, because VS should ask from the runtime what regex the cucumber expression is translated to, so the two should use the same regex at the end... But let's see.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I tried step transforms enum->enum and string->enum but it didn't help :(
I've just noticed that the complaint about ambiguous steps is on only one of the steps. However, the parameter highlighting is correct on both steps, so it is obviously finding the right steps at some point.
… On 19 Sep 2024, at 07:52, Gáspár Nagy ***@***.***> wrote:
To simplify the things, for example the two step defs are marked as ambiguous (although they work fine as test):
[Then("the batch with ID {int} should {BeDeletedOrNot}")]
[Then("the batch with ID {int} should be updated")]
Questions:
• What are the values in the BeDeletedOrNot enom (or it does not matter)?
• Do you have a [StepArgumentTransformation] defined for the enums?
It is really strange that it works differently in VS and in test execution, because VS should ask from the runtime what regex the cucumber expression is translated to, so the two should use the same regex at the end... But let's see.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
I've noticed something else in my small test project. Not all of the steps are marked as ambiguous, but sometimes the parameters are correctly coloured. I’ve attached a small test project with the scenarios detailing that.
I tried writing step argument transforms, both enum to enum, and string to enum. Didn’t help, unfortunately ☹
… On 19 Sep 2024, at 07:52, Gáspár Nagy ***@***.***> wrote:
To simplify the things, for example the two step defs are marked as ambiguous (although they work fine as test):
[Then("the batch with ID {int} should {BeDeletedOrNot}")]
[Then("the batch with ID {int} should be updated")]
Questions:
• What are the values in the BeDeletedOrNot enom (or it does not matter)?
• Do you have a [StepArgumentTransformation] defined for the enums?
It is really strange that it works differently in VS and in test execution, because VS should ask from the runtime what regex the cucumber expression is translated to, so the two should use the same regex at the end... But let's see.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
@JimCooperFromGmailAccount Do you have a chance to figure out what makes the difference between the ones that are problematic and the ones that are not? Can you maybe also share the small test project (although I probably cannot check it before Monday). |
I have a theory that an enum parameter as the first and/or last thing in the step expression is causing the trouble, because those seem to sometimes match as if they were (.*) regexes. If they're in the middle somewhere there is more to differentiate between the steps. The troublesome steps also share some common text. |
Yes, the attachment is downloadable now. I will check it next week. |
Excellent, thanks :-)
… On 19 Sep 2024, at 11:18, Gáspár Nagy ***@***.***> wrote:
Yes, the attachment is downloadable now. I will check it next week.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Used Visual Studio
Visual Studio 2022
Are the latest Visual Studio updates installed?
Yes
Content of reqnroll.json (if present)
No response
Issue Description
There is an issue in the editor, where these pairs of step definitions are marked as ambiguous.
So they are marked with a red squiggly line, and also go to declaration/definition doesn't work
The feature.cs files are generated and the tests pass, correctly, with the correct steps being hit.
It seems to be an issue with using enums (here BeDeletedOrNot, Pep, WikiMarkup and OnOrOff are all enums)
It's like the regular expression (.*) is being used in the analysis instead of the possible enum values.
[Then("the batch with ID {int} should {BeDeletedOrNot}")]
[Then("the batch with ID {int} should be updated")]
[Then("the projected value of {Pep}[{int}] should be {double}")]
[Then("{WikiMarkup} should be {OnOrOff}")]
Steps to Reproduce
Create steps using enums, as shown above. The problems are all in the editor. The tests themselves are generated correctly
Link to a project repository that reproduces the issue
No response
The text was updated successfully, but these errors were encountered: