TFS 2017 test case history - tfs

We recently upgraded from TFS 2012 to TFS 2017. In 2012 you could see the history of the test case in the Summary tab. When it was passed etc. I can't find that in 2017. Is it there?
Any guidance would be very helpful

If you mean view the recent test results for an individual test case, then you can select the test case within a test suite and then choose to Show/hide details pane. Then check the Test Result for a specific test case.
Navigate to Test hub --> Select the specific Test Plan then Test suite --> Select a specific Test Case --> Click Show/hide details pane --> Select Test results from pane list --> view the results for a specific test case.
Besides, you can also use the REST API to get the test case and Test Run list
However, it's not so easy to get the test run history for a specific test case, unless you run only the specific test case each time. In fact, usually we will run multiple test cases in a test run.
REST API to get the test case :
GET http://SERVER:8080/tfs/DefaultCollection/2017ScrumProjectFromVS/_apis/test/plans/105/suites/106/testcases/107?api-version=1.0
REST API to get the test run list :
GET http://server:8080/tfs/DefaultCollection/2017ScrumProjectFromVS/_apis/test/Runs/
Actually the best way to retrieve test cases run status history is
using MTM (Microsoft Test Manager):
Connect TFS server -->> Select the Team Project -->> Select Test
tab >> Select the test plan -->> Select the specific test case -->>
View Results -->> At the end of the opened page you will see the result history (All test runs for the specific test case).

Related

Include tests from child suites when exporting test plans in TFS

When Exporting Test plan , i get plenty of Test Suites with 0 Test cases .
Though Every one of those Test Suites have multiple Child Test Suites with Multiple Test cases each .
How am i able to include the Test cases from the Child Test Suite in the Exported Report ?
It works well in my side, the test case is located under corresponding test suite.
When you do the export through right click the test plan, please make sure you have selected selected suite+children and check the test cases with step option.
Update:
Simply select the test plan you want to export, and right click the test plan, select Export.

Microsoft Test Manager 2015

Please see the picture below for reference. Does anyone know how to associate Test Runs to a PBI in TFS Microsoft Test manager. The 3 results I have circled below I had to manually associate each Test Run to the PBI. Is there a way to have them automatically link up? Test Cases automatically do this. (Tested By)
To associate automated test results with PBI, you could do this directly from test result page.
On the test results page, select the tests you want to link to PBI and choose the Associate tests to work item (link) icon.
Select the PBI from the list of suggested work items and choose Associate.

TFS 2018 - How to view complete history for each test case

We are running TFS version 2018 RTW (16.122.27102.1). I am trying to view the complete run history for my each of my test cases. I am only seeing the last couple of test runs when I go to the Build -> Tests -> Click on a test -> Right panel shows a graph with the link "View History" below it. The graph is only showing the last couple of test runs:
The Build definition I am working with has a retention policy of 15 days and a minimum to keep of 3. TFS seems to be only showing history for builds it has not yet deleted. However, the box "Automated test results" is not checked - I am under the impression that not checking this box should allow me to see the completed history of my test runs.
How can I view the completed history of my test runs without having to retain all my builds?
Additional Details
My build specific retention policy is listed first. This means it will override the global policy if I understand correctly.
I can see all the test runs for my deleted builds. However the test history for each individual test only shows 3 bars. I was expecting to see 8 bars (the current 3 plus the 5 test runs from the deleted builds).
There are not only the build retention policy in your build definition, but also a Global build retention policy
Global build retention policy settings can be managed from the Build and Release settings of your account or team project collection:
TFS 2018: https://{your_server}/tfs/DefaultCollection/_admin/_buildQueue
You could not be able to change the delete test results value in the policy there. So if your builds fit the global policy, the test result will still be deleted.
Besides, you could use the REST API to get the test case and Test Run list.
However, it's not so easy to get the test run history for a specific test case, unless you run only the specific test case each time. In fact, usually we will run multiple test cases in a test run.
REST API to get the test case,
GET http://SERVER:8080/tfs/DefaultCollection/2017ScrumProjectFromVS/_apis/test/plans/105/suites/106/testcases/107?api-version=1.0
REST API to get the test run list :
GET http://server:8080/tfs/DefaultCollection/2017ScrumProjectFromVS/_apis/test/Runs/
Actually the best way to retrieve test cases run status history is
using MTM (Microsoft Test Manager):
Connect TFS server -->> Select the Team Project -->> Select Test
tab >> Select the test plan -->> Select the specific test case -->>
View Results -->> At the end of the opened page you will see the result history (All test runs for the specific test case).
We also found that the ability to view easily view a test cases' result history was lost when we moved from MTM.
There is a feature request uservoice here https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/2037641-provide-more-visibility-for-a-test-case-s-result-s
However, if you have got MTM handy, you can use the the following workaround
1) In TFS, click on "Test" from the top menu and select the test suite where your test case is. Select the test case that you are interested in. Then Click pass or fail button. This will generate a manual test run for the given test.
2) Go to MTM -> Test --> Analyze Test Run. Select option "Manual Runs" in the View option.
3) Open the test run. Right click on test and click "View Results"
4) The list of results will show you the manual run as well as automated runs, which is what you are looking for.
Hope it helps!!

Bulk change of Test Case status in Microsoft Test Manager for a particular Test suite

I'm new to Microsoft Test Manager. I have lot of Test suites in my MTM and want to change the status of each test case from Design to Ready state in a particular test suite.
Is there a way to do it in MTM or TFS without individually changing each and every test case status manually. (There are no tags for the Test Case and I tried to query by test suite name but it doesn't work).
Note:
I know the I could change the state of the test suite to In progress and All the test cases will be available for testing.
Thanks in advance.
If you have latest version of tfs on web test hub you may select several test (screens from vsts):
set new value for the State field
You can write a query in TFS to find all the test cases that meet your criteria.
Export into Excel (or Import using TEAM tab in Excel) and change all the values and publish the results back.
Or on the latest version of VSTS I can select all the WI's in the Query Result, right click and select "Edit", then change the State to Ready and save all.

Specify Order in which Coded UI Tests are executed for TFS Test Agent

I'm trying to setup TFS 2010 Lab Management based Automated Testing system and I have a "Test suite" (Created in TFS Test Manager) with following tests:
1) Start and Login
2) Create group
3) Create user and add to the group
These have order specified properly in Testing Center->Plan->(Test suite)->Order column
However, when they are executed (on TFS Lab Management Build) by Test Agent they run out of order: 2nd then 1st and then 3rd.
Is there a way to make Test Agent run these tests in order?
Thanks.
Create an Ordered Test, it's a simple list of which test methods should run and in what order.
I also had the same issue. I solved it by installing VS2010 Service Pack and TFS 2010 Service Pack in both the Test controller machine and Test agent machines. Please go through the following link for more details
http://social.msdn.microsoft.com/Forums/en-US/vsmantest/thread/29ac3c7b-b0cd-40f3-9992-f5f3c2285331
Unfortunately, There's a blog regarding ordering test cases which says:
Please note this only applies to the manual tests but not automated
tests. For automated tests, the order you set here will not be
respected during test execution.
http://blogs.msdn.com/b/vstsqualitytools/archive/2009/11/21/run-your-tests-in-the-order-you-want.aspx
I don't know if it's a new feature but you can create Ordered tests. Just right click on your project in Solution Explorer and choose Add -> Ordered Test. Select you tests in order.
In Test Explorer, run you ordered test.
Details are in the link below but all I had to do is what I'd said above. I am using VS 2015 Enterprise.
https://msdn.microsoft.com/en-us/library/ms182631.aspx

Resources