简体   繁体   English

Jenkins JavaScript测试的测试覆盖率报告

[英]Jenkins test coverage report for JavaScript tests

We run a CI environment with Jenkins and the Project is in ExtJS 3.2. 我们使用Jenkins运行CI环境,并且该项目在ExtJS 3.2中。 I am not able to find a clear line on how to setup the test coverage for JS code in Jenkins. 我无法找到关于如何在Jenkins中设置JS代码的测试范围的明确方法。 We write UI tests using selenium and Cucumber. 我们使用硒和黄瓜编写UI测试。 The build file has a UI tests target which is run every time the CI machine runs a build. 构建文件具有UI测试目标,每次CI机器运行构建时都会运行该目标。 I am not able to find a plugin that will give me or publish the coverage report of these tests that have been run as a resulting atrifact in Jenkins. 我找不到能给我提供或发布这些测试的覆盖率报告的插件,这些测试是在詹金斯(Jenkins)中导致不合时宜的结果。 Or please help me out if there is some other way to achieve the same thing. 或者,如果还有其他方法可以实现同一目标,请帮助我。

I think you can use JSCover to generate code coverage when using Selenium: 我认为您可以在使用Selenium时使用JSCover生成代码覆盖率:

  • Start JSCover java web service 启动JSCover Java Web服务
  • Let Selenium hit the JSCover web-app and start the collector, also see the manual of JSCover about automated tests. 让Selenium进入JSCover Web应用程序并启动收集器,另请参阅有关自动测试的JSCover手册
  • Run the Selenium tests in a new window or iFrame 在新窗口或iFrame中运行Selenium测试
  • Collect the coverage data and store it somewhere 收集覆盖率数据并将其存储在某处
  • Process the data into a nice report (possible with genhtml ) 将数据处理成一个不错的报告(可以使用genhtml

If you start a new browser for each Cucumber scenario/feature, then you need to save the coverage data between each scenario/feature, combine them after all features are done and then process them into a nice report. 如果为每个Cucumber场景/功能启动一个新的浏览器,则需要保存每个场景/功能之间的coverage数据,在完成所有功能后将它们合并,然后将它们处理成一个不错的报告。 JSCover supports merging of multiple data sources and creating LCOV reports. JSCover支持合并多个数据源并创建LCOV报告。

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

相关问题 没有单元测试的javascript覆盖率 - javascript coverage without unit tests JavaScript Jasmine单元测试范围 - JavaScript Jasmine unit test coverage 生成JavaScript客户端的测试覆盖率 - Generate test coverage for JavaScript client Jenkins / SonarQube JavaScript的单元测试代码覆盖率 - Jenkins/SonarQube unit testing code coverage for JavaScript 根据覆盖率报告删除未使用的 javascript 代码 - Remove unused javascript code based on coverage report 带有Mocha测试用例的Istanbul覆盖率仅显示规格文件(测试文件)的覆盖率报告 - Istanbul coverage with mocha test cases only showing coverage report for spec files (test files) 通过不计算间接测试的覆盖率来强制用户测试依赖关系 - Force user to test dependencies by not counting coverage for indirect tests Jest覆盖率测试报告的准确性如何? Jest测试覆盖率如何计算? 我应该如何分析覆盖结果? - How accurate is a Jest coverage test report? How is Jest test coverage calculated? How should I analyze the coverage findings? 带有node-jscoverage,mocha和express的功能测试覆盖率报告 - Functional test coverage report with node-jscoverage , mocha and express TFS 2015中的Javascript单元测试代码覆盖率 - Javascript unit test code coverage in TFS 2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM