How to speed up UI tests in Xcode (when using a storyboard)?

719 views Asked by At

I am trying to speed up the execution of UI tests in Xcode 8. I tried following the solution presented in the following stackoverflow post:

How to speed up UI test cases in Xcode?

However, using that solution did not work in my case, I think because I am using a storyboard.

So instead of writing:

func application(application: UIApplication,
             didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool{
    if NSProcessInfo.processInfo().arguments.contains("UITests") {
        UIApplication.sharedApplication().keyWindow?.layer.speed = 100
    }
}

I wrote:

func application(application: UIApplication,
             didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool{
    if NSProcessInfo.processInfo().arguments.contains("UITests") {
        UIApplication.shared.delegate.window??.layer.speed = 100
    }
}

The change is in the 4th line. From what I understand, because I am using a storyboard the optional keyWindow is not ever being set. So I tried setting the speed of the window property of delegate, but unfortunately that didn't work either.

Can anyone point me in the right direction as to how I can speed up UI tests if I am using a storyboard?

0

There are 0 answers