When Running Unit Tests "No tests were found" using ReSharper and Jasmine on Visual Studio Cordova - visual-studio-cordova

When running unit tests using ReSharper and Jasmine as the unit testing framework I get "no tests were found in file" in my visual studio cordova project. But when I run my visual studio library project it works fine with the unit tests. It seems like in the cordova project ReSharper cannot detect the tests. Has anyone else ran into this issue? What was your resolution?

Andrew, I was able to get the jasmine tests running in ReSharper. I had to create a separate test project in Visual Studio. ReSharper was able to then recognize the jasmine code. I also had to add ///<reference src="javascript source" > for each source file that was required in my spec files.

Related

Running Nunit Test Cases cross platform

I have developed some End to End tests using Selenium, and Nunit.
I need to run the test cases cross-platform so I created a .net core class library project and developed the tests.
Now I am struggling with figuring how to run the tests outside visual studio.
The first step I did is publishing the project using:
dotnet publish project
Then I found out that I can run Nunit tests using nunit-console.exe, but I'm not sure that it supports cross-platform.
Is what I am trying to accomplish doable? or shall I replace Nunit with other option?
To run .Net Core tests, including NUnit tests, use the dotnet test command. It is cross-platform.
What I did to achieve running Nunit Test Cases cross platform:
1- Running dotnet publish project with specifying target runtime.
3- Running dotnet vstest with specifying file containing tests.

Visual Studio 2017 Test runner is discovering my tests but not running them

Using the default Visual Studio Testing Framework, the runner is finding all of my tests but when I try to run the tests I get a bunch of tests all part of the same project that are not successfully running. These same tests run fine in Resharper.
is there something that I am missing? there doesn't appear to be any errors when I run the tests, they just don't run at all. (I even called them directly and still have issues.)
Found the issue, apparently having "ForcedLegacyMode" set to true caused the issue. I assume this was automatically turned on by VS 2017 because some of the projects were created in VS 2013.

build Coded UI tests in TFS 2017 + vsTest + error

I have codedUI and unit tests in my solution. Solution and the unit tests are successfully building in TFS 2017. CodedUI tests fail. I get an error.
Failed to initialize the unit test extension 'urn:CodedUITest': A unit test extension is not registered for the following attribute: Microsoft.VisualStudio.TestTools.UITesting.CodedUITestAttribute.
All the tests successfully pass in my local machine. What configuration am I missing in my build process?
kindly, help!.
According to the error info, seems the issue should more related to build agent Environment setting. Make sure you have Visual Studio and Coded UI features installed on the build agent. You could double check this by remote to the build agent and manually run Code UI in the agent machine instead of through TFS build.
If you are using Nuget Visual Studio Test Platform Installer , this is not support for now, take a look at the similar issue: VSTS build release agent unable to run Coded UI tests when using the Nuget VsTest platform
Currently Coded UI and UWP tests not support with VSTest platform
nuget package. /cc #PBoraMSFT for blog/doc and timeline for support.

Using TestTools.UnitTesting .Net Core

I am building a new project with .NET Core using Visual Studio 2015. The project builds and compiles as expected. I tried to to add a reference to Microsoft.VisualStudio.TestTools.UnitTesting the way I would do this with a ASP.NET project would be References->Add Reference etc. Seems I am unable to add it this way with Visual Studio 2015. I found an article here that suggests building a project from the CLI. dotnet new mstest. However that results in this message on my machine:
Specify --help for a list of available options and commands.
Unrecognized command or argument 'mstest'
I tried the same command on Ubuntu machine and it creates the project without a problem.
I am on a Windows machine.
Any insight on this?
I see the same on my computer when I try to use dotnet new mstest as well as dotnet new xunit for Visual Studio 2015 on Windows 10. I tried dotnet new mstest in Developer Command Prompt for VS 2017 and it worked fine, though.
I don't know the reason for sure as to why it's not available for 2015, it might be a limitation at this time of the dot net core tooling available for VS 2015 on Windows.
However, the reason I'm posting this as an answer is because I was eventually able to get mstest setup with the following workaround:
I had to manually include the following into the appsettings.json file of a new .Net CORE project that I created through the Visual Studio 2015 IDE:
"testRunner": "mstest",
"dependencies": {
"dotnet-test-mstest": "1.1.1-preview",
"MsTest.TestFramework": "1.0.4-preview",
...
}
After that, mstest works for me in that project in VS 2015 and tests are discovered by the Test Explorer.

Running Protractor Integration Tests on an Asp.net(C#) / AngularJS Project in Visual Studio 2015

I am using Visual Studio 2015 for a MVC-/angularJS -project.
I have written a couple of Integrationtests using the Protractor nuget package.
The problem is, I can only run these tests on deployed versions of the project.
Is there a way to run the Integrationtests against a freshly compiled version in running in debug-Mode on the same machine?
Maybe this blogpost will help you: NUnit Unit Testing of ASP.NET Pages.
AngularJS or not shouldn't make a difference with this guide.

Resources