ios - 是否可以通过 xcode ui 测试来测试丢失的 wifi 连接?

标签 ios xcode-ui-testing

我想使用 xcode ui 测试对我的 iOS 应用程序如何处理丢失的 wifi 连接进行一些测试。看来 xcode ui 测试只能让你控制应用程序,而不是手机。有什么办法吗?

提前致谢。

最佳答案

您可以模拟来自服务器 API 的响应以返回 nil 而不是状态代码,这样您就可以检查应用的行为以及它如何响应服务器请求。 恐怕您无法在 UI 测试运行时关闭网络连接。

关于ios - 是否可以通过 xcode ui 测试来测试丢失的 wifi 连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36142855/

相关文章:

iphone - 如何在 iPhone 的特定窗口 block 中显示 UIImageView 中的图像

iphone - ios 查找所有保存的文件

ios - 为什么我在 UI 自动化工具中看到 "An error occurred while trying to run the script."?

ios - 对于 CCScene 标签检查中的循环 CCSprites?

ios - 如何遍历多个 XCUIElements

swift - 如何使用 Perform(withKeyModifier :block:) function in XCUITest

ios - SwiftUI TextEditor UI 测试 typeText 方法失败

iphone - 从MPMoviePlayerController获取总帧数

ios - XCTest UI 测试 UIElements 大小

ios - xcode UITests 检查测试是否在真实设备上运行