SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

low priority; reset the table number per feature file for generation (v3)

Open BasHamer opened this issue 6 years ago • 13 comments

SpecFlow Version:

  • [X] 3.0

Used Test Runner

  • [X] MSTest

Visual Studio Version

  • [x] VS 2017

The current behavior is that a lot of your generated files will show a delta when you add a single file. This is because of the table being a number calculated over all the feature files.

Here is an example commit with a lot of these changes. https://github.com/BasHamer/PossumLabs.Specflow.Selenium/commit/4fc2e3a58972d9328e0606fb34cc5755e34cb345

see for example: PossumLabs.Specflow.Selenium.UnitTests/features/Google.feature.cs

not a big deal but it does create more noise for people to review for check-ins.

BasHamer avatar May 06 '19 21:05 BasHamer

Why do you checkin the feature.cs files at all? You are already using the MSBuild generation.

SabotageAndi avatar May 07 '19 07:05 SabotageAndi

i have the same problem with nunit. when you gonna fix it>

nikitozeg avatar May 07 '19 14:05 nikitozeg

@nikitozeg When do you provide the PR for it? ;-)

SpecFlow is an open source project. Everyone can contribute to it.

SabotageAndi avatar May 07 '19 14:05 SabotageAndi

@nikitozeg When do you provide the PR for it? ;-)

SpecFlow is an open source project. Everyone can contribute to it.

I am glad to fix this issue, but not sure what class and methods need to be fixed

nikitozeg avatar May 07 '19 14:05 nikitozeg

@SabotageAndi, To answer the question, the reason why I opened it isn't for the people that can easily dig through the code and diffs. This is for folks who are introduced to C# trough Specflow. When you are learning lots of moving parts can be very overwhelming, and unexpected changes in files you didn't think you touched are scary when you have not yet learned to trust your tools. It is a UX thing for novice coders/developers.

BasHamer avatar May 08 '19 02:05 BasHamer

@nikitozeg the code for it is here: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow.Generator/UnitTestFeatureGenerator.cs#L698

@BasHamer you are right, the code-behind file is part of the UX. We could be better to describe that part of SpecFlow.

SabotageAndi avatar May 09 '19 16:05 SabotageAndi

@nikitozeg the code for it is here: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow.Generator/UnitTestFeatureGenerator.cs#L698

@BasHamer you are right, the code-behind file is part of the UX. We could be better to describe that part of SpecFlow.

I really need for fix this issue, as soon as possible. And I din't know how to debug this generator

nikitozeg avatar May 11 '19 10:05 nikitozeg

how to fix it please

nikitozeg avatar May 15 '19 15:05 nikitozeg

well i just did this and it fixed image

nikitozeg avatar May 16 '19 10:05 nikitozeg

Hi, I have the same issue, when I'm adding a new scenario with a table to feature file, specflow assign a new number (for example - TechTalk.SpecFlow.Table table51 ) for table and old tables number going to change. VS2017 - 15.9.6 SpecFlow.Tools.MsBuild.Generation - 3.0.213 SpecFlow - 3.0.213 NUnit - 3.12

goncharr avatar May 28 '19 12:05 goncharr

Why do you checkin the feature.cs files at all? You are already using the MSBuild generation.

VS check this difference between files

goncharr avatar May 28 '19 13:05 goncharr

@BasHamer I am also facing the same issue. Please share the solution if you have resolved it. Thank you.

VS 2022 MS Test Specflow version : 3.9.50

AshwiniChandan123 avatar Jul 07 '23 17:07 AshwiniChandan123

Same issue, Is there any workarounds?

VStClair avatar Jul 24 '23 14:07 VStClair