Code Coverage with Appium for iOS

柔情痞子 提交于 2019-12-13 17:17:24

问题


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...

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.

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

Appreciate any help with this!


回答1:


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.

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

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



来源:https://stackoverflow.com/questions/39233514/code-coverage-with-appium-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!