Open icnocop opened 1 year ago
I have the same issue
@gasparnagy I also have the same issue after upgrading to v17.5.0; this is a big issue for us.
I'm facing the same issue. Test project using .NET Core 3.1 Visual Studio Professional 2022 (64-bit) - Version 17.5.0
@jrod567 @EngSimoes @icnocop @bhugot This is really bad... Unfortunately I don't think we can fix that on SpecFlow side.
This is not something that the SpecFlow VS extension or SpecFlow does. SpecFlow does not add the test items to the test case explorer, but generates MsTest (or NUnit or xUnit) C# methods that have the C# line pragmas to tell the compiler where the source line is. All the rest is done by the the test runners VS integration and VS itself.
Could you please try if it works with NUnit or xUnit?
If yes: please submit an issue to the MsTest team, if not: please submit an issue to the VS team.
I use NUnit
The same issue occurs for NUnit, MsTest and xUnit.
There is already an open issue on VS feedback forum, but they will likely close as it is related to "Other Product". https://developercommunity.visualstudio.com/t/Test-Explorer-SpecFlow-tests:-goes-to/10291227?q=specflow&sort=newest
There is an open discussion on the Specflow community, but there is no action occurring. https://support.specflow.org/hc/en-us/community/posts/9366318388893
I do understand that the issue may not be related to Specflow itself, but this has a big effect on the day-to-day use of the tool.
https://user-images.githubusercontent.com/5269989/221570113-9cfe6850-f84f-4236-b48a-f0af1a9dac82.mp4
Have you tried to disable source-code based test discovery in VS? (Uncheck the box below)
@EngSimoes If you can, try to make a repro with a standard MsTest test (without SpecFlow) that has a pragma like
#line 1 "MyFile.txt"
before the test. You should be able to reproduce the issue with that and submit it to the VS support case, so that they will not close it as "other product" issue.
And of course all of you should add votes to https://developercommunity.visualstudio.com/t/Test-Explorer-SpecFlow-tests:-goes-to/10291227 otherwise it is not taken seriously.
@gasparnagy unchecking is not working
NUnit here as well - I've commented/voted on the VS issue for good measure.
Good news! Fix is coming... https://developercommunity.visualstudio.com/t/Test-Explorer-SpecFlow-tests:-goes-to-/10291227#T-N10296634
Hi, it is fixed now on version 17.5.2.
https://developercommunity.visualstudio.com/t/Test-Explorer-SpecFlow-tests:-goes-to-/10291227
Thanks for the help @gasparnagy!
Used Visual Studio
Visual Studio 2022
Are the latest Visual Studio updates installed?
Yes
Issue Description
After updating Visual Studio 2022 to v17.5.0, the "Go To Test" feature in "Test Explorer" no longer works as expected.
Visual Studio jumps to the generated code-behind file instead of the feature file.
Steps to Reproduce
<PropertyGroup>
<LangVersion>latest</LangVersion>
Notice Visual Studio jumps to the generated code-behind file ".\Features\Calculator.feature.cs" on line 70.
I expected Visual Studio to jump to ".\Features\Calculator.feature" line 9.
SpecFlow for Visual Studio 2022 v2022.1.91.26832 - 2022-12-20
It worked without issues in Visual Studio 2022 v17.4.