【发布时间】:2016-04-21 13:45:09
【问题描述】:
我们有一套使用 KIF 编写的应用程序的 UI 测试,我想将其转换为使用新的 Xcode UI 测试框架。
我们目前的一些测试是这样工作的:
Assert that there are no objects in a core data table
Do some stuff in the UI
Assert that there are some objects in the core data table
Cancel the thing we were doing in the UI
Assert that there are no leaked objects in the core data table
我需要查看实际的核心数据存储,而不仅仅是 UI,因为泄露的行不一定会显示在 UI 中。如何从 Xcode UI 测试访问核心数据存储?
【问题讨论】:
-
@import 可测试您的模块,然后直接访问核心数据存储(就像您在应用程序中一样)
-
@ogres 我不知道那是什么意思。这是一件快事吗?我的应用和测试都是 Obj-C。
标签: ios objective-c core-data xcode-ui-testing