-
Notifications
You must be signed in to change notification settings - Fork 9
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
Visual Studio Extension does not acknowledge setting 'stepDefinitionSkeletonStyle' #18
Comments
Hm... the referred code is just for the "default" expression style. I think that is OK, the question is why isn't it overridden. @clrudolphi can hopefully find the root cause. |
@gasparnagy I could use some guidance on how to proceed. Oddly enough, when I attempt to recreate this through the Tests/Specs, the opposite occurs. I can get Regex to work but not Cucumber. Is that because the stubs don't support that? |
@clrudolphi I did check 😆 It is not using the config, because it is not implemented in the VS extension.... 😀 Background: In SpecFlow those who had the special cucumber expression plugin wanted cucumber expression snippets anyway. And in case of the cucumber expression plugin we were setting the special trait, so the "default" snippet calculation was "good enough" and no one missed the config. But now the trait is always set for Reqnroll, so the config is getting important again. We need to implement that. In the Tests/Specs maybe the cuke ex trait is not set on the stubbed project and this is why you get a different default as usual. It would be good to change the stub to have the cuke ex trait by default. This can be done in The implementation might be something like:
|
@gasparnagy : Thanks for the pointers. Almost done.
The schema for the Reqnroll.json file however, says that the element should be "stepDefinitionSkeletonStyle" Which is correct? |
Unfortunately the "skeleton" one is the correct. https://github.com/reqnroll/Reqnroll/blob/main/Reqnroll/Configuration/JsonConfig/TraceElement.cs#L25 (The "snippet" is the cucumber compatible term and "skeleton" was a term I introduced 15 years ago, but I can't get rid of that, it seems.) |
Would you like the Documentation page updated to have it match the schema? |
Latest code is now at this branch: https://github.com/clrudolphi/Reqnroll.VisualStudio/tree/GH18 |
Since it uses the 'skeleton' term, I'll create a PR. |
…tionSkeletonStyle' (#18) * FIX for GH18 Fix for GH18. Modified the way Reqnroll.json is deserialized to pull in the values from the 'Trace' element. Sets a new property on DeveroomConfiguration to reflect the json config. Modified the SnippetService to use that value (rather than the Traits) when creating the snippet provider. * GH18: Corrected one existing DefineStepsCommand.feature scenario since the stubbed configurations now set the default to be CucumberExpression.
Fixed by #19 |
Used Visual Studio
Visual Studio 2022
Are the latest Visual Studio updates installed?
Yes
Content of reqnroll.json (if present)
{
"trace": {
"stepDefinitionSkeletonStyle": "RegexAttribute"
}
}
Issue Description
It appears that the VS2022 Extension does not currently change behavior when setting the 'stepDefinitionSkeletonStyle' to 'RegexAttribute'.
The expected behavior is that the 'Define Steps' button should show Regex-based step definitions, but will always seem to show Cucumber expressions.
I have had a dig into the codebase, with @timothy-plummer-ul and it seems like the main culprit is the following line:
When using Reqnroll, the flag for 'ReqnrollProjectTraits.CucumberExpression' is always set here, and does not appear to check the config file for it's value inside the 'ReqnrollProjectSettingsProvider' class:
I have experimented with reading from the config file, which seemed to enable the expected behavior of the config point, so it seems like this is a bug in the extension.
Steps to Reproduce
{ "trace": { "stepDefinitionSkeletonStyle": "RegexAttribute" }}
Link to a project repository that reproduces the issue
No response
The text was updated successfully, but these errors were encountered: