Skip to content
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

Language is not recognized from app.config #162

Closed
jaspervhaastert opened this issue Feb 8, 2022 · 3 comments
Closed

Language is not recognized from app.config #162

jaspervhaastert opened this issue Feb 8, 2022 · 3 comments

Comments

@jaspervhaastert
Copy link

The plugin does not recognize the feature file language when set in an app.config file.
Rider underlines the whole file in red with the error message The file does not contain a feature.
Running the test is not an issue, then the language is correctly recognized from the app.config file.

Sample app.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
    </configSections>
    <specFlow>
        <language feature="nl-NL" />
    </specFlow>
</configuration>

Sample feature file:

Functionaliteit: Calculator

Scenario: Add two numbers
    Gegeven the first number is 50
    En the second number is 70
    Als the two numbers are added
    Dan the result should be 120
@Socolin
Copy link
Collaborator

Socolin commented Feb 8, 2022

Hello,

The plugin support the version 3 of specflow. But I think it can work if you add a specflow.json file, see
https://docs.specflow.org/projects/specflow/en/latest/Installation/Configuration.html

Does this fix your problem ?

@jaspervhaastert
Copy link
Author

Unfortunately that's not really an option.
Most developers at work use Visual Studio.
I work on a lot of repositories of other teams, who won't appreciate me adding such an extra file when it's not necessary for them.

According to the link you posted, app.config files are still supported in version 3 of specflow when using .NET framework.
Is there any way support for these files can be added to this plugin?

@Socolin
Copy link
Collaborator

Socolin commented Feb 10, 2022

I don't know when I'll have time to support this, I see 2 solutions if you want to get it to work now:

  • Since you could replace the app.config with the specflow.json there would be no extra file.
  • If you cannot add this file, I think as a workaround for now you can add it on your side and put it in .gitignore.

I think it could be a simple change at those 2 location
https://github.com/SpecFlowOSS/SpecFlow.Rider/blob/master/src/dotnet/ReSharperPlugin.SpecflowRiderPlugin/Caching/SpecflowJsonSettings/SpecflowSettingsFilesCache.cs#L33
https://github.com/SpecFlowOSS/SpecFlow.Rider/blob/master/src/dotnet/ReSharperPlugin.SpecflowRiderPlugin/Caching/SpecflowJsonSettings/SpecflowSettingsFilesCache.cs#L49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants