SpecFlow.VisualStudio icon indicating copy to clipboard operation
SpecFlow.VisualStudio copied to clipboard

Culture sr-Cyrl - Cannot generate step definitions

Open valentinajemuovic opened this issue 5 years ago • 2 comments

SpecFlow Version:

  • [x] 3.0
  • [ ] 2.4
  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

  • [ ] SpecFlow+Runner
  • [ ] MSTest
  • [ ] NUnit
  • [x] Xunit

Version number: 2.4.1

Project Format of the SpecFlow project

  • [ ] Classic project format using packages.config
  • [x] Classic project format using <PackageReference> tags
  • [ ] Sdk-style project format

.feature.cs files are generated using

  • [x] SpecFlow.Tools.MsBuild.Generation NuGet package
  • [ ] SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • [x] VS 2019
  • [ ] VS 2017
  • [ ] VS 2015

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • [ ] Enabled
  • [ ] Disabled (I don't know about this setting)

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No, I use Visual Studio version <Major>.<Minor>.<Patch>

.NET Framework:

  • [ ] >= .NET 4.5
  • [ ] before .NET 4.5
  • [ ] .NET Core 2.0
  • [ ] .NET Core 2.1
  • [x] .NET Core 2.2
  • [ ] .NET Core 3.0

Test Execution Method:

  • [x] Visual Studio Test Explorer
  • [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

<SpecFlow> Section in app.config or content of specflow.json

{
  "language": {
    "feature": "sr-Cyrl-RS"
  }
}

Note: I have tried both "sr-Cyrl-RS" and "sr-Cyrl", but neither of them work.

Repro Project

Issue Description

I tried the culture "ru-RU" which works correctly but the culture "sr-Cyrl-RS" does not work correctly (build error)

Steps to Reproduce

  1. Open the attached demo solution in VS 2019: SpecFlowDemo.zip
  2. Rebuild the solution. The project "Russian" builds correctly, whilst the project "Serbian" fails to build.
  3. Open the Test Explorer, there will be one test for "Russian", run it, the test runs successfully,
  4. No tests appear for "Serbian".

valentinajemuovic avatar Jul 06 '19 13:07 valentinajemuovic

  1. In the Serbian project the specflow.json is named specflow1.json, so we can't find it and can't read the language config.
  2. sr-Cyrl-RS doesn't work, but sr-Cyrl works.

SabotageAndi avatar Jul 08 '19 06:07 SabotageAndi

Thanks for that, I now fixed specflow.json and build works, so I've now attached the zip file where build works: SpecFlowDemo_02.zip

However, the next issue I get is as follows:

  1. Inside the Serbian project, I open the file SpecFlowFeature1.feature
  2. There is no syntax highlighting appearing for the key words (feature, scenario, Given, When, Then, etc.)
  3. When I right -hand click and on the menu I select "Generate step definitions" then I get the error dialog "Object reference not set to an instance of an object"

valentinajemuovic avatar Jul 09 '19 05:07 valentinajemuovic