我正在使用 xcode 8.3.3,swift,我试图让 tearDown 方法只运行一次。
我使用此处提供的解决方案启动应用程序一次: XCTestCase not launch application in setUp class method
在 tearDown 方法中,我想注销应用程序。我只想这样做一次。
XCTest 文档有一个类 tearDown() 方法,但是当我尝试使用它时 - 它不再有权访问应用程序?: https ://developer.apple.com/documentation/xctest/xctestcase/understanding_setup_and_teardown_for_test_methods
这就是我在 tearDown 方法中得到的全部内容,因此它不能再访问应用程序上的任何元素:
如何在所有测试结束时只运行一次 tearDown 中的代码?