Unable to monitor event loop AND Wait for app to idle

后端 未结 2 1726
孤城傲影
孤城傲影 2021-02-05 13:50

I am writing UITest cases for my app using XCTest. App makes several server calls in the homescreen. I could not navigate to next screen. Automation often stays idle for 1 min o

2条回答
  •  春和景丽
    2021-02-05 14:16

    I have set arguments in UI test class

    let app = XCUIApplication()
    app.launchArguments = ["NoAnimations"]
    app.launch()
    

    In my Appdelegate's didFinishLaunchingWithOptions method I made a check

     NSArray *args = [NSProcessInfo processInfo].arguments;
    
        for (NSString *arg in args){
            if ([arg isEqualToString:@"NoAnimations"]){
                [UIView setAnimationsEnabled:false];
            }
        }
    

    So now all over my app there wont be any animation and my app is no more blocked. This reduced my automation time from 25mins to 2mins.

提交回复
热议问题