Xcode UI测试手册快照 [英] Xcode UI test manual snapshot

查看:127
本文介绍了Xcode UI测试手册快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Xcode 7中的UI测试手动从我的应用程序中获取一些快照。默认情况下,Xcode会截取每个步骤的屏幕截图,结果我获得了在视图控制器之间转换过程中拍摄的屏幕截图。我想在特定时刻手动拍摄快照。任何想法如何做到这一点?我知道如何截取UIView的截图,但是XCUIApplication没有提供任何API来获取UIView对象。

I want to manually take some snapshots from my applications using UI Tests intoduced in Xcode 7. By default, Xcode takes screenshots of every step and in result I got screenshots that was taken in the middle of transitions between view controllers. I want to manually take snapshot in the specific moments. Any ideas how to do this? I know how to take screenshot of UIView, but XCUIApplication doesn't provide any API to get UIView objects.

推荐答案

我是为此创建了一个库: https://github.com/zmeyc/UITestUtils
这个想法是在应用程序本身截取屏幕截图并通过套接字将其发送到测试应用程序。我没有找到直接从测试应用程序以受控方式捕获屏幕截图的方法。

I've created a library for this: https://github.com/zmeyc/UITestUtils The idea is to take the screenshot in the app itself and send it to the test app via sockets. I didn't find a way to capture screenshots in a controlled manner directly from the test app.

这篇关于Xcode UI测试手册快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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