SpecFlow-VS-Mac-Integration icon indicating copy to clipboard operation
SpecFlow-VS-Mac-Integration copied to clipboard

Generate Tests From MsBuild

Open Kapusch opened this issue 5 years ago • 5 comments

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 !

Kapusch avatar Apr 30 '20 09:04 Kapusch

@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

Moshex avatar Apr 30 '20 18:04 Moshex

@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

Mittchel avatar Jun 09 '20 10:06 Mittchel

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

Kapusch avatar Jun 09 '20 20:06 Kapusch

@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.

Mittchel avatar Jun 10 '20 07:06 Mittchel

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

bmacedo87 avatar Sep 04 '20 10:09 bmacedo87