-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Test from Test Explorer Does Nothing #1457
Comments
This is a productivity killer for sure, since we are working with numerous feature files and test order does not match since they get automatically sorted in Test Explorer. I had to revert to 2.x until this gets fixed :( |
I have upgrade today, same configuration as you and for me it works. |
@nuzolx good news for you :) I will try again another day, too much time spent on this for me. |
Have the same bug! |
Please provide an example to reproduce this issue. |
After update to newest speclfow my Test Explorer window in VS 2017 doesn't show any tests. I did no changes after update specflow except removed config about nunit runner from app.config. Problem fixed after move this lines at the bottom of csproj file:
|
I experience this issue too. It seems to be caused by the new way in which the generated code is not longer included in the Previously, the generated code was part of the <Compile Include="Test.feature.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Test.feature</DependentUpon>
</Compile> If you keep this code in the projectfile for your feature files after migrating, opening the test from the test explorer will still work. A source is then available too. Another option is: simply include the generated file as part of your solution. However, this will bloat the view in the Solution Explorer by having both the <Compile Include="Test.feature.cs" />
<None Include="Test.feature" /> Both solutions require manual labour in the Note: when simply adding a |
I repeat, I need a project to reproduce this issue. Complete to clone from where, no step for step description. Jumping from the test explorer to the feature file works in the SpecFlow solution. There we are using xUnit. So please provide us one. Thanks! |
@SabotageAndi I will try to create a test project when I get a chance to do so :-( Sorry I cannot do that right now, since I really do not want to move away from SpecFlow. |
@rik-smeets work around worked for me (using mstest.testframework). Some additional notes:
|
And if I would get a project to reproduce it, I could fix it correctly for all .... |
@SabotageAndi I think I can get around to creating an example project for it this Sunday. |
@SabotageAndi I created an example project for it over at https://github.com/rik-smeets/specflow-3-test-explorer. In the feature files is a description of the occurring issue and the possible workarounds as I described before. Let me know if you need any further information or help. Thanks! |
@rik-smeets thanks for the repro project. I can reproduce the issue. I think it's because it is a project in the old format. For the new format we do this: https://github.com/techtalk/SpecFlow/blob/master/SpecFlow.Tools.MsBuild.Generation/build/SpecFlow.Tools.MsBuild.Generation.targets#L40
But it looks like, this doesn't work with the old format. |
@SabotageAndi Thanks for your analysis. What do you mean with 'old format'? Do you mean compared to .NET Core projects? The repro project is a new solution/project, created from scratch in Visual Studio 2019, targeting .NET Framework 4.7.2. I didn't change anything to the defaults. |
old project format is the long one, where a lot of stuff is in the xml file. |
Alright, thank you. Do you think this issue can be resolved within the possible limitations of the old .csproj format? |
I am not sure. I have to talk with a colleague who is a master of MSBuild. |
@SabotageAndi Hello there. Have you discovered any more information on this or perhaps have a workaround documented somewhere on how to handle/correct the old .csproj format? |
@dcdraper Nothing new to report. As written I can reproduce it, but had no success with fixing it. |
I had yesterday a talk with @DanielTheCoder about this issue. There is nothing we can do about it automatically. :-/ |
@SabotageAndi Thanks for your analysis. I migrate projects to the new csproj format where possibly, but in some cases (like with non-Core ASP.NET applications), this isn't a possibility. Perhaps there is a solution (sort of)... If the SpecFlow extension detects that the 'classic' .csproj format is used, then it should insert this in the .csproj (which I now do manually to make sure tests can be opened from test explorer, as I explained before): <Compile Include="[feature name].feature.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>[feature name].feature</DependentUpon>
</Compile> Just like with SpecFlow <3, but of course still without the SpecFlowSingleFileGenerator. What do you think about that? |
The solution of @sjeanren has many problems. |
In deed, it's just an improvement of the workaround, to avoid to add each feature one by one. |
So to fix this issue we should convert our CSPROJ files to new format, e.g. like described here? |
@varajan Yes |
Hi @rik-smeets, I am encountering the same issue. I've followed your steps exactly, but I am still not able to use the test explorer to navigate to my tests. It is still saying "source not available". DId anybody else experience the same problems? Am i missing something? Thnx in advance. |
@rik-smeets I'm encountering the issue when running vs2019; "Go To Test" fails. I cannot go to a test from test explorer. But all appears fine when I regress back to vs2017. VS2017 Test Explorer - ApplicationDisplaysListofAvailableTabs appears once (correct) VS2019 Test Explorer - ApplicationDisplaysListofAvailableTabs appears twice (incorrect) |
I actually solved the issue by remove *.feature.cs from in csproj file |
Hi Please can anybody advise? |
@jarjarbinks9999 |
Yes they were thank you .
…Sent from my iPhone
On 17 Jun 2020, at 17:21, Rik Smeets ***@***.***> wrote:
@jarjarbinks9999
Are you sure you have installed both the MSTest.TestFramework and the MSTest.TestAdapter NuGet packages in your test project(s)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@SabotageAndi |
I recently migrated to Specflow 3.4.31 and I have the same issue in Visual Studio 2019. Test explorer shows "No source available" for my specflow tests, so double click will not end up going to the actual specflow test (feature file). Any updates regarding this? It would be a nightmare to migrate to the new csproj format in my case. |
Hello, has there been any progress regarding this issue? I recently started to get this and tried to apply @rik-smeets workaround but it does nothing for me. |
Hi, any update regarding this issue? |
@peraltakeit & @michaelhuang1168 Are you using the old csproj format or the SDK- csproj format? |
I converted it to 2019 format following @rik-smeets workaround (but I believe all the projects in my solution used to have the old csproj format), does that still count as the old csproj format? I am quite new to this so sorry if its a stupid question. |
@SabotageAndi I just converted the csproj to the new format and it's working now. |
that is the exact same tool i used. does it matter that i am using specflow+runner instead of nunit runner? |
Hi, BoDi" version="1.5.0" feature.cs file generation is generating at build time., Is there a permanent fix to be expected for this? Does the csproj file conversion to the new format apply to new projects created in VS2019? Thanks. |
@ashafi1430 No, there is no permanent fix expected. And I don't think we can fix it. |
I ran into the same problem. I found that special characters in test naming cause this problem, e.g. >, ), (. |
Visual Studio - Can no longer open test (F12) from Test Explorer, attempts do nothing
SpecFlow Version:
Used Test Runner
Version number:
Visual Studio Version
Are the latest Visual Studio updates installed?
.NET Framework:
Test Execution Method:
<SpecFlow> Section in app.config
Repro Project
Issue Description
Steps to Reproduce
Expected: The feature file will open and the selected test will be in focus, like it was in SpecFlow2.x
The text was updated successfully, but these errors were encountered: