适用于iOS的Appium的代码覆盖率 [英] Code Coverage with Appium for iOS

查看:264
本文介绍了适用于iOS的Appium的代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题似乎已经以多种不同的方式被问到了,所以如果我只是想在这里漏掉一些明显的东西,请事先道歉,但这对我来说仍然不清楚...

This question seems to have been asked in a number of different flavours already, and so apologies in advance if I'm just missing something obvious here, but this still isn't clear to me...

我正在使用Appium作为功能测试套件的一部分运行UIAutomation测试,如何从该套件生成代码覆盖率指标?理想情况下,然后可以在Jenkins中可视化这些结果,作为CI流程的一部分.

I'm running UIAutomation tests using Appium as part of a functional test suite, how do I go about generating code coverage metrics from that suite? Ideally be able to visualise these results in Jenkins then, as part of a CI flow.

我看到一个人有解决方法此处,我尝试实现此解决方案,但是该应用程序不会在关闭时生成任何形式的覆盖率报告,我希望将应用程序发送到后台并随后杀死后,它会在其当前目录中创建覆盖率指标的转储,但不幸的是,它并没有带来喜悦.

I see one guy has a solution here, and I tried implementing this, but the application does not generate ay form of coverage report on shutdown, I was expecting once the app was sent to the background, and subsequently killed, that it would create a dump of the coverage metrics in its current directory, but no joy unfortunately.

Appium网站上似乎有文档使用Android进行此操作,但对于iOS却看不到

There seems to be documentation on the Appium site for doing this with Android, but nothing that I can see for iOS

对此表示感谢!

推荐答案

对于处于类似情况的用户,我们通过添加解决方案

For those who are in a similar situation, we got to the bottom of this by adding the additional steps outlined in the solution here by user "Ed-E G", as well as following the steps in the Github issue.

我们缺少XCode中的生成测试覆盖率文件"和仪器程序流"设置.

We were missing the "Generate Test Coverage Files" and "Instrument Program Flow" settings in XCode.

一旦我们添加了这些额外的设置,并通过Appium运行了UIAutomation测试,则在关机时,该应用会在派生数据"文件夹中转储一组gcda文件,该文件可由

Once we added those extra settings, having run the UIAutomation tests through Appium, on shutdown now the app dumps a collection of gcda files in the Derived Data folder, which can be interpreted by gcovr and translated into Cobertura result XML files, to be displayed in Jenkins using the Cobertura plugin

这篇关于适用于iOS的Appium的代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆