简体   繁体   English

使用量角器e2e测试来测量代码覆盖率Java

[英]Measuring code coverage java using protractor e2e test

There are a two projects one of them is written java is a backend code one of them is angular typescript frontend codes. 有两个项目,其中一个是用Java编写的,是一个后端代码,其中一个是有角度的打字稿前端代码。 i wrote e2e tests in the frontend project. 我在前端项目中编写了e2e测试。 now i want to measuring backend code coverage using this e2e test please help 现在我想使用此e2e测试来测量后端代码覆盖率,请帮助

Code Coverage is a measurement of how many lines/blocks/arcs of your code are executed while the automated tests are running. 代码覆盖率是对在运行自动测试时执行了多少行代码/块/弧的度量。

Search online code coverage tools that can help you, protractor is just end to end testing tool, you need another tool for code coverage. 搜索可以帮助您的在线代码覆盖率工具,量角器只是端到端测试工具,您需要另一个工具来进行代码覆盖率。

At a high level, 在高层次上

  1. Instrument cli generated main.js file with grunt protractor coverage 仪器cli生成的main.js文件覆盖了量角器
  2. Deploy this as part of your build 将其作为构建的一部分进行部署
  3. Run Protractor tests on the application 在应用程序上运行量角器测试
  4. Capture coverage for each spec via a collector port 通过收集器端口捕获每个规格的覆盖范围
  5. Consolidate spec json files with remapIstanbul 使用remap合并规范json文件
  6. Generate report 产生报告

The devil is in the details :-) 细节决定成败 :-)

https://github.com/r3b/grunt-protractor-coverage https://github.com/r3b/grunt-protractor-coverage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM