来自Xcode UI Test的截图文件在哪里? [英] Where is the screenshot file from Xcode UI Test?

查看:183
本文介绍了来自Xcode UI Test的截图文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很感兴趣如何找到在我的应用的UI测试期间创建的屏幕截图的位置。我想了解Fastlane Snapshot如何抓取此屏幕截图。经过几个小时的研究后,我无法找到这些屏幕截图的位置。

I'm interested how to find the location of a screenshot which is created during UI Tests of my app. I would like to understand how Fastlane Snapshot grabs this screenshot. After couple of hours of research I can't find location of those screenshots.

推荐答案

屏幕截图存储在Derived Data文件夹中。您可以通过转到Xcode,Window> Projects并单击项目的派生数据路径旁边的小箭头来找到它。

Screenshots are stored inside your Derived Data folder. You can find this by going to Xcode, Window > Projects and click the little arrow next to your derived data path for the project.

从项目派生数据文件夹(应该是你的文件夹的名称,后面加上字母),转到日志/测试

From your project derived data folder (should be the name of your folder with a load of letters after it), go to Logs/Test.

里面Test文件夹将是测试摘要.plist文件,其名称中包含UUID(每个测试运行一个),文件夹名为附件 - 屏幕截图位于此处。

Inside the Test folder will be test summary .plist files with UUIDs in their names (one per test run) and a folder called Attachments - the screenshots are in here.

如果这些文件夹中没有任何文件夹,请确保先运行测试。

If any of these folders aren't there, make sure you've run the tests first.

要弄清楚哪个你想要的截图,你需要挖掘* _TestSummaries.plist文件。在Xcode中打开它并按照您感兴趣的SubActivity进行测试摘要。一些SubActivities没有截图,并且 HasScreenshotData 键设置为

To work out which screenshot you want, you'll need to dig through the *_TestSummaries.plist file. Open it in Xcode and follow the test summary down to the SubActivity you're interested in. Some SubActivities don't have screenshots, and will have the HasScreenshotData key set to NO.

当您找到包含屏幕截图数据的SubActivity时,请将该SubActivity的UUID与屏幕截图的文件名相匹配附件文件夹。

When you find a SubActivity with screenshot data, match the UUID for that SubActivity with the filename of the screenshot in the Attachments folder.

我的屏幕截图位于: / Users / {username} / Library / Developer / Xcode / DerivedData / {project_name} -tywebfjsswmghapfjfbzhuazjf / Logs / Test / Attachments

在.plist中,我关注了此路径可查找事件的屏幕截图数据的详细信息: TestableSummaries>项目0>测试>项目0>分测验>项目0>分测验>项目0> ActivitySummaries> <项1>子活动>项目0

In the .plist, I followed this path to find details of the screenshot data for an event: TestableSummaries > Item 0 > Tests > Item 0 > Subtests > Item 0 > Subtests > Item 0 > ActivitySummaries > Item 1 > SubActivities > Item 0.

这篇关于来自Xcode UI Test的截图文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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