TFS 2015 Test case association with test method - unit-testing

I created a test case (work item) in Visual Studio Team Services (previously Visual Studio Online) and associated it with an automated test.
Can I run the automated test from the web UI ?
When I run the dll of the solution from build definition, the test is running,
but how can I get the information about the test case thats associated with the test ?

1 - You can run a build which runs your tests. I don't think you can run individual tests.
2 - You can access the test case iteration data using the DataRow property on the TestContext.
testContextInstance.DataRow["Name"].ToString();

You cant run individual automated Test Cases in the Web yet, but you can run them from Microsoft Test Manager.
On the "run" tab in MTM you can select any automated test cases and create a test run for a particular build (where it gets the DLL) and a particular environment (where that build is deployed).

Related

How to display detailed test results on Azure Devops (Builds)?

I created a simple task on Azure Devops, to run Unit Tests on my project.
For that, I'm using the Visual Studio Test task and everything works fine.
The "problem" is that, when I navigate to build results and go to Test Results, I can only see the failed tests, or in case when all tests succeed, I can't see any.
I'm not sure if it's possible, but ideally I wanted to see all tests results, regardless if they failed or not, so that I can see it more analytical.
Thanks.
It seems there's a column that controls that visibility.

How can we run C++ Unit Test in Github Workflow?

I am using Microsoft Unit Testing Framework. I have successfully created and used the tests to check the program. I want to create an assignment for students where the same test cases can run as a workflow so that the assignments can be checked on every push on Github repository. How to configure the workflow so that the workflow use the test file in the folder to run the tests?

Azure DevOps 'Run Only Impact Tests' doesn't work with XUnit Tests?

I have an ASP.net Web API project (.NET Framework v4.6.2) where I have written unit test cases using XUnit.
I have created a build pipeline in Azure DevOps with 'Run only impacted tests' set to checked. Also, my Visual Studio test version is set to *2.** in my test assemblies.
I have tried to run my mock tests (No data driven test cases) to check that only impacted test run but all the tests run.
I had hard luck finding the solution for It. Can anyone know how to do it right?
I have read this article and and done setting accordingly, but failed.

Wanted to create UI interface for Business developer team which contains Test Cases

I wanted to create UI interface for Business developer team which contains Test scripts which are written in my PC in selenium with c#.
Problem :-
Business developer team has no visual studio installed in their PC
because they don't have licence for it.Now if they wanted to show
demo of Application to client then if they have UI which contains
Test scripts which i wrote in selenium.so how could i display those
Test script on business developers laptop which don't have visual
studio?
Here for demo purpose to client ,Business developer team will
click on particular test case on UI and run that feature. For
example ,If Business developer wanted to show Login feature in UI at
Business developer laptop then that script should run.
how can i define connectivity between business developer's laptop
which don't have visual studio and source laptop which has visual
studio which contain Test script?
It's kind of R & D work,If anybody has idea about this let me know.
To do this, you are going to have to setup some kind of infrastructure to support this. You could achieve this through setting up a build server and making a build plan per collection of test scripts. This is going to let the BDs run the tests, but not look into the tests till the execution is done. You will require proper reporting in order to do so.
What you could also do is use a tool like browserstack. With (I am not affiliated with browserstack what so ever) browserstack you can make every executed test viewable through their recording function and every step of every test will be administrated. This way, you execute the test once, they login into browserstack and check every test, test step, expected results, actual results, screenshots and 30 day history recording of each and every test executed.
You don't need an IDE to run your tests. The person who wishes to run tests to show off some features of the site should be able to download your test codebase and run it locally from the command line. If they don't want to pass in a lot of flags at the command line, you could bundle the commands into batch or shell scripts.

All tests are executed although no code changes

In vNext (TFS 2017.3 on prem) I have a build definition which builds a .NET application and run around 3000 tests.
In my Visual Studio Test task I have enabled "Run only impacted tests" to decrease build time. I have done several builds at the same branch (Git) where I know there are no code changes. So my expectation was that the first build would take more time that if the "Run only impacted test" wasn't enabled because it should do extended analysis.
But then in the next build I would assume that no tests were executed as the code haven't changed.
But what is actually happen is that only 14 tests are "Not impacted".
Do you know why?
TIA is presently scoped to the following:
Supported
TFS 2017 Update 1 onwards and on VSTS
Version 2.* of the Visual Studio Test task in the build definition
Build vNext, with multiple VSTest Tasks
VS2015 Update 3 onwards on the build agent
Local and hosted build agents
CI and in PR workflows
Git, GitHub, External Git, TFVC repos
IIS interactions (over REST, SOAP APIs), using HTTP/HTTPS protocols
Automated Tests
Single box topology (tests and application must be running on the
same machine)
Managed code (any .NET Framework application, any .NET Service)
Not yet supported
Multi box topology (where the test is exercising an app deployed to a
different machine)
Data driven tests
Test Adapter-specific parallel test execution
.NET Core
UWP
Please check whether you have a supported scope. More details please refer to the blog below:
https://blogs.msdn.microsoft.com/devops/2017/03/02/accelerated-continuous-testing-with-test-impact-analysis-part-1/