繁体   English   中英

在 Swift 中使用 UITesting 捕获屏幕录制

[英]Capture screen recording with UITesting in Swift

是否有任何工具或服务可以使用 UITesting 捕获屏幕录制或屏幕截图?

不想https://github.com/pointfreeco/swift-snapshot-testing进行快照测试。

谢谢,

您可以在方案中配置它

在此处输入图像描述

首先,您还需要在附件部分中删除“每次测试成功时删除”中的复选标记删除“每次测试成功时删除”中的复选标记

然后你可以在测试日志中找到截图

在此处输入图像描述

您还可以使用screenshot()截取不同组件的屏幕截图

let screenShot = emailTextField.screenshot()
let emailScreenAttachment = XCTAttachment(screenshot: screenShot)
emailScreenAttachment.name = "screnshot of email textField"
emailScreenAttachment.lifetime = .keepAlways
add(emailScreenAttachment)

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM