Disabling waiting for idle state in UI testing of iOS apps

后端 未结 5 1123
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 12:37

Basically the problem is the same as this one: XCTestCase: Wait for app to idle

I am using perpetually repeating \"background animations\" in my views. The !@#$#$&@

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 12:52

    I used h.w.powers' solution in Objective-C, in case anyone needs it.

    For setting up:

    XCUIApplication *app = [[XCUIApplication alloc] init];
    app.launchEnvironment = @{@"UITEST_DISABLE_ANIMATIONS":@"YES"}; 
    [app launch];
    

    and then in your code

    if ([[[NSProcessInfo processInfo] environment][@"UITEST_DISABLE_ANIMATIONS"] isEqualToString:@"YES"]) {
    // do something like stopping the animation
    }
    

提交回复
热议问题