How to change the time it takes to take a snapshot in Xcode UI Test (XCUITest)?

I am doing some performance experiments, and I continue to get this error using Xcode UI tests, as the new UI Test statement didn’t hit:

UITesting Failure - Failed to get snapshot within 15.0s

How can I change this 15.0s variable to something longer? Is there any configuration or setting that I can change?

+4
source share
2 answers

. , 15.0s, , . :

var timeToDelay = 60.0
repeat {
    let delay = min(13.0, timeToDelay)
    timeToDelay -= delay
    let date = Date().addingTimeInterval(delay)
    let predicate = NSPredicate(format: "now() > %@", argumentArray: [date])
    self.expectation(for: predicate, evaluatedWith: [], handler: nil)
    self.waitForExpectations(timeout: 14.0, handler: nil)
} while timeToDelay > 0

, , timeToDelay ( ).

+2

, . Apple 20 , , .

, Apple ~ 5 , . , 15- .

20- , XCTest 15.

0

Source: https://habr.com/ru/post/1664500/


All Articles