作者:快乐天使小可爱66 | 来源:互联网 | 2023-09-02 15:51
Iamusingxcode8.3.3,swift,andIamtryingtogetthetearDownmethodtorunonlyonce.我正在使用xc
I am using xcode 8.3.3, swift, and I am trying to get the tearDown method to run only once.
我正在使用xcode 8.3.3,swift,我试图让tearDown方法只运行一次。
I launch the application once with the solution provided here: XCTestCase not launching application in setUp class method
我使用此处提供的解决方案启动应用程序一次:XCTestCase不在setUp类方法中启动应用程序
In the tearDown method, I want to logout of the application. I only want to do this once.
在tearDown方法中,我想注销该应用程序。我只想做一次。
The XCTest documentation has a class tearDown() method, but when I try to use it - it doesn't have access to the application anymore?: https://developer.apple.com/documentation/xctest/xctestcase/understanding_setup_and_teardown_for_test_methods
XCTest文档有一个类tearDown()方法,但是当我尝试使用它时 - 它不再能访问应用程序了吗?:https://developer.apple.com/documentation/xctest/xctestcase/understanding_setup_and_teardown_for_test_methods
This is all I get when I am in the tearDown method and so it can't access any elements on the application anymore:
这是我在tearDown方法中获得的所有内容,因此它无法访问应用程序上的任何元素:
How can I run the code in the tearDown just once at the end of all tests?
如何在所有测试结束时只在tearDown中运行一次代码?
2 个解决方案