xctwaiter

How to test async functions in swift using XCTWaiter and exceptions

寵の児 提交于 2019-12-11 17:35:02
问题 I want to test asynchronous functions in Swift, hence as shown below, I created a XCTestExpectation and passed it on to an XCTWaiter . Now, irrespective if the expectation is fulfilled or not, I get a test ran successfully always . Can you point out what is wrong in the code. I followed exactly a blog which was made for Swift 3, however, I am running Swift 4. Is that the issue? func testAsyncFunction() { let expectation = XCTestExpectation(description: "Some description") vc.asyncFunction(5)

Delay/Wait in a test case of Xcode UI testing

浪子不回头ぞ 提交于 2019-11-28 02:49:21
I am trying to write a test case using the new UI Testing available in Xcode 7 beta 2. The App has a login screen where it makes a call to the server to login. There is a delay associated with this as it is an asynchronous operation. Is there a way to cause a delay or wait mechanism in the XCTestCase before proceeding to further steps? There is no proper documentation available and I went through the Header files of the classes. Was not able to find anything related to this. Any ideas/suggestions? Asynchronous UI Testing was introduced in Xcode 7 Beta 4. To wait for a label with the text

Delay/Wait in a test case of Xcode UI testing

ⅰ亾dé卋堺 提交于 2019-11-26 23:49:59
问题 I am trying to write a test case using the new UI Testing available in Xcode 7 beta 2. The App has a login screen where it makes a call to the server to login. There is a delay associated with this as it is an asynchronous operation. Is there a way to cause a delay or wait mechanism in the XCTestCase before proceeding to further steps? There is no proper documentation available and I went through the Header files of the classes. Was not able to find anything related to this. Any ideas