gpt4 book ai didi

ios - 在 Xcode 中多次自动运行测试用例

转载 作者:可可西里 更新时间:2023-11-01 03:31:13 25 4
gpt4 key购买 nike

在 Xcode 中,有没有办法让我自动运行单个测试用例 n 次?

这样做的原因是我的一些 Beta 测试人员在我的应用程序中遇到随机崩溃。我在 TestFlight 中看到了崩溃日志以及堆栈跟踪,但我无法重现崩溃。

崩溃很少发生,但当它发生时,它总是在用户尝试创建数据库记录时发生,然后将其上传到服务器。崩溃日志的问题是我的代码没有出现在它们的堆栈跟踪中(所有 UIKit 和 CoreFoundation 的东西——而且每次都不同)。

我的解决方案是对应用程序的该部分运行 100 次测试,设置异常断点,以尝试在我的开发环境中触发错误。但我不知道如何自动执行此操作。

最佳答案

花了 7 年时间,但从 Xcode 13 开始,现在内置了对测试重复的支持。

来自 Xcode 13 release notes :

Enable test repetition in your test plan, xcodebuild, or by running your test from the test diamond by Control-clicking and selecting Run Repeatedly to bring up the test repetition dialog.

关于ios - 在 Xcode 中多次自动运行测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24708899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com