Closed TimMurphy closed 1 month ago
@gasparnagy - I've attempted to find an authoritative source online for what characters are legal in a step, but not having any luck finding anything that addresses this question. Which non-alphanumeric characters are allowed (or not allowed)? With that, I'll take a look at what needs to be changed to address this issue.
Thanks
On Wed, 19 June 2024, 01:48 Chris Rudolphi, @.***> wrote:
@gasparnagy https://github.com/gasparnagy - I've attempted to find an authoritative source online for what characters are legal in a step, but not having any luck finding anything that addresses this question. Which non-alphanumeric characters are allowed (or not allowed)? With that, I'll take a look at what needs to be changed to address this issue.
— Reply to this email directly, view it on GitHub https://github.com/reqnroll/Reqnroll.VisualStudio/issues/28#issuecomment-2176429373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADFDDRHQUJPGLF4KPYD5L3ZIBJGRAVCNFSM6AAAAABJMIOK46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWGQZDSMZXGM . You are receiving this because you authored the thread.Message ID: @.***>
@TimMurphy here are my findings so far. When using the default stepDefinitionSkeletonStyle of Cucumber expressions, I get the same behavior you note in this issue. When I use the older Regex style, I get the following code skeleton generated by the "Define Steps..." Command:
[When(@"I call the integer\.ToString\(\) method")]
public void WhenICallTheInteger_ToStringMethod()
{
throw new PendingStepException();
}
Would the above work for you? Are you wanting to use Regex expressions or Cucumber expressions? If the above is OK, then try using the Regex style snippet generator by modifying your reqnroll.json configuration file and insert the following:
"trace": { "stepDefinitionSkeletonStyle": "RegexAttribute" },
See the Documentation for details on the reqnroll.json configuration file.
HTH. I'll keep looking for an explanation of the behavior while using the Cucumber expression style.
@clrudolphi
That works perfect;y. Thanks for that and for all your work to create and main Reqnrol
For the record, the cucumber expression syntax specification is here: https://github.com/cucumber/cucumber-expressions?tab=readme-ov-file#escaping
@TimMurphy Thank you for your sponsorship! 🙏🤘
For the record, the cucumber expression syntax specification is here: https://github.com/cucumber/cucumber-expressions?tab=readme-ov-file#escaping
Good to know but I rather have "clean" specs with regex steps.
Used Visual Studio
Visual Studio 2022
Are the latest Visual Studio updates installed?
Yes
Content of reqnroll.json (if present)
Issue Description
When a step in a feature includes brackets (), the regex for the step definition created by Define Steps... is incorrect .
As an example if you have the following step
The generated step is:
Notice how the brackets of the steps are written as \). The generated code should be:
Steps to Reproduce
Create a feature with the following scenario.
Right click in the feature file and select Define Steps....
The Define Steps window will show the when step as
Link to a project repository that reproduces the issue
No response