straighteight / SpecFlow-VS-Mac-Integration

Visual Studio for Mac SpecFlow integration
34 stars 14 forks source link

Generate Tests From MsBuild #24

Open Kapusch opened 4 years ago

Kapusch commented 4 years ago

Hello,

Firstly, thanks for providing this extension for VS Mac which works great !

I've recently encountered the following error while running my first UI Test : System.InvalidOperationException : Result collection has not been started

Accordingly to https://github.com/SpecFlowOSS/SpecFlow/issues/1851#issuecomment-573692539 , it appears that SpecFlowSingleFileGenerator is not anymore compatible with SpecFlow 3.x versions.

It is apparently now strongly recommended using MSBuild to generate code-behind files, according to this SpecFlow documentation.

As this is not possible to disable SpecFlowSingleFileGenerator CustomTool in the SpecFlow extension for VS Mac, I've been succeed to workaround the initial error by manually emptying Generator attribute :

<None Include="Features\Whatever.feature">
    <Generator>SpecFlowSingleFileGenerator</Generator>
    <LastGenOutput>Whatever.feature.cs</LastGenOutput>
</None>

into this :

<None Include="Features\Whatever.feature">
    <Generator></Generator>
    <LastGenOutput>Whatever.feature.cs</LastGenOutput>
</None>

My questions are :

  1. Is it the good way to remove custom tool without breaking anything else ?
  2. Did you plan to integrate MSBuild instead of SpecFlowSingleFileGenerator custom tool ?

Thanks in advance !

Moshex commented 4 years ago

@Kapusch I could be wrong, but I don't think your issue has with this repo, you might have better luck with this issue asking it here https://github.com/SpecFlowOSS/SpecFlow/issues

Mittchel commented 4 years ago

@Kapusch I am experiencing the problem that my Feature file is missing in the Solution after installing the SpecFlow.Tools.MSBuild.Generation package. Are you experiencing this as well?

Might be related to this issue: https://github.com/SpecFlowOSS/SpecFlow/issues/1920

Kapusch commented 4 years ago

Hi @Mittchel , no the problem is not about missing files.

Mittchel commented 4 years ago

@Kapusch could you maybe tell me how you got things working on VS Mac? I am missing syntax highlighting and also the .feature files are missing in my solution. On VS Windows everything works.

I did the following:

  1. Added VS Mac addin from gallery
  2. Created .NET Core 3.1 NUnit test project
  3. Added SpecFlow nuget
  4. Added the SpecFlow.NUnit nuget
  5. Added the MSBuild generation package.

The test are running fine but like I said I am missing syntax highlighting and also missing the .feature file in my solution.

bmacedo87 commented 4 years ago

Exactly the same here @Mittchel, were you able to get these things working?