-2

How to get code coverage for client side JavaScript codes in a web application written by c# asp.net web forms using dot net framework 4.6 for UI tests through MTM automated test runs or through TFS 2013 Build as type of Build-Deploy-Test when client has Windows OS and browser is chrome or edge?

Build-Deploy-Test is a XAML Build as Lab Default Template.

AhmadYo
  • 334
  • 3
  • 6
  • Do you have unit tests written for Javascript code? – Thaadikkaaran Oct 10 '16 at 10:15
  • Which version of TFS are you using? These link might help you: https://blogs.msdn.microsoft.com/visualstudioalm/2012/07/09/javascript-unit-tests-on-team-foundation-service-with-chutzpah/, http://www.colinsalmcorner.com/post/enabling-javascript-code-coverage-link-in-builds. – Cece Dong - MSFT Oct 11 '16 at 02:50
  • @JaganathanBantheswaran No. It is not about unit test written for JavaScript code. It is about code coverage of client side codes when running UI automated tests. – AhmadYo Oct 11 '16 at 19:17
  • TFS 2013. version added to post. – AhmadYo Oct 11 '16 at 19:19
  • @AhmadYo If you dont have JS code, Then what you mean by "Code Coverage" ?. What kind of code you have written for UI ? – Thaadikkaaran Oct 12 '16 at 09:05
  • @JaganathanBantheswaran There is JavaScript codes in Client Side of web app (asp.net), but there isn't unit test written in JS or for testing JS. There is automated UI tests. Therefor it's very helpful to measure which JS codes run during UI tests. – AhmadYo Oct 13 '16 at 20:13

1 Answers1

0

Here is the MSDN article which explains how to enable code coverage with MTM automation.

This requires 2012.1 0r later versions of Visual Studio, Test Controller, Test Agent and TFS.

Edit

If you want to get Javascript code coverage, you have to write unit tests for Javascript code with mocha/jasmine and then use any of the code coverage tools (istanbul) available

Community
  • 1
  • 1
Thaadikkaaran
  • 5,088
  • 7
  • 37
  • 59
  • Thanks, but the answer is irrelevant. The MTM code coverage adapter, get coverage of codes inside assemblies and don't get coverage of JavaScript codes. the question is clear. It's about running UI test over a web application and measure coverage of JavaScript codes. which codes run during automated UI tests and which not. – AhmadYo Oct 15 '16 at 07:56