Skip to content
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

Tests not discovered in Visual Studio Test Explorer Window #358

Closed
OstenL opened this issue Jun 23, 2014 · 11 comments
Closed

Tests not discovered in Visual Studio Test Explorer Window #358

OstenL opened this issue Jun 23, 2014 · 11 comments

Comments

@OstenL
Copy link

OstenL commented Jun 23, 2014

Hi,

I'm having a problem with Test Explorer Window not discovering tests when SpecFlow is configured to run with SpecRun.

I have a simple project created according to the setup instructions and it works perfectly in VS2013 Premuim on Windows 8.1. with an App.Config file like this.

<specFlow>
<unitTestProvider name="SpecRun" />
<plugins>
<add name="SpecRun" />
</plugins>
</specFlow>

However, when i copy the same project to a machine with Windows 7 the test discovery silently fails, and no tests are found in the Test Explorer Window.
I have tried this on several combinations of Visual Studio and OS on different computers.

Specflow1.9.0, SpecRun 1.2.0 and 1.3.0-alpha1 (same result for both versions), .NET4.5

Windows 8.1 x64, VS2012 Premium, Update 4 : Works
Windows 8.1 x64, VS2013 Premium, Update 2 : Works
Windows 7, x64, VS2010 Pro, SP1 (.Net4.0) : Fails.
Windows 7, x86, VS2012 Premium : Fails.
Windows 7, x64, VS2013 Pro, Update2 : Fails.

In all cases the "Run Specflow Scenarios" command works just fine and runs the test with SpecRun so SpecRun itself works ok.

If I set unitTestProvider = "SpecRun+MsTest" the MSTest versions of the test scenarios are discovered in all cases but SpecRun is not used when running the tests from the Test Explorer.

It seems to be related to Windows 7 but I cannot find what the problem is.
Has anyone experienced this and have a clue to how to solve or how to debug this problem?

@defyjoy
Copy link

defyjoy commented Jan 28, 2015

I suppose this has been resolved with the nuget package of xunit runner/ nunit runner runners for specflow ?

@carlin-q-scott
Copy link

I have this same issue with Windows Server 2012. I think the VS plugin is at issue since I also see that it isn't offering to rebuild the feature files when I change my test provider in app.config. It does this on the machine that's working but not on the one that isn't.

@gasparnagy
Copy link
Contributor

Visual Studio caches the test runner adapters, and in the most of the cases a corrupted cache is the reason for this. To clean the cache, you have to do the following:

1.       Close all Visual Studio instances
2.       Go to %TEMP%\VisualStudioTestExplorerExtensions\
3.       Delete specrun related folders
4.       Try again

I close this, please reopen if you see any further issues.

@fday04
Copy link

fday04 commented Feb 18, 2016

@gasparnagy: I had a similar issue wherein the Visual Studio 2013 won't recognise any tests created by specFlow in the Test Explorer. I tried restarting the application, readding the NuGet Packages to my project and upon trying your advice, I wasn't able to find the path %TEMP%\VisualStudioTestExplorerExtensions\ in the windows explorer.

Do you have any other ideas to get this done?

@tadesushilgithub
Copy link

Under Visual studio project properties > Application > Output type should be Class Library . If you have unitTestProvider = "SpecRun" if enought no need to add MsTest reference in library.

@cterry-mw
Copy link

so, Gasparnagy, we found that you need to delete the folders, and the 'specflow-stepmap~' CACHE files, that exist in that folder ...

@jjzgithub
Copy link

Hmm.. mine was a mistake in that I converted a method into a [TestMethod] not checking for the following constraints reported in the output window:
Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, return-type must be Task if you are running async unit tests.

Methinks this should be an outright compile error, rather than successfully compiling, but not showing up p on the Test Explorer.

@sarla2010
Copy link

I just removed all installed packages and added them again from NuGet gallery. Tests are loaded then in explorer.

@SimonSDA
Copy link

SimonSDA commented Apr 26, 2017

I had to remove and re-add the SpecFlow.nUnit package, update it (to 2.1.0) then add 'NUnit3TestAdapter' - it seems I needed this since nUnit got updated to v3. Also 'SpecFlow.nUnit.Runners' does NOT work (for me at least) - it adds an extension class that won't compile.

@KrishnarajLoganathan
Copy link

Install NUnit and NUnit3TestAdapter continue build project, now Test explorer will display all tests.

install nunit3and nunittestadapter to run unit

@lock
Copy link

lock bot commented Jul 9, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests