无法监控事件循环并等待应用程序空闲 [英] Unable to monitor event loop AND Wait for app to idle
问题描述
我正在使用XCTest为我的应用程序编写UITest案例.应用程序在主屏幕上进行了多个服务器调用.我无法导航到下一个屏幕.自动化通常比消息
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 or even more than that with the message
等待应用空闲
或
无法监视事件循环
Unable to monitor event loop
是否有一种方法可以使应用执行我的测试案例,从而打破了这个???
Is the there a way to make the app to execute my testCases breaking this ???
推荐答案
我已经在UI测试类中设置了参数
let app = XCUIApplication()
app.launchArguments = ["NoAnimations"]
app.launch()
在我Appdelegate的didFinishLaunchingWithOptions方法中,我进行了检查
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];
}
}
因此,现在我的整个应用程序将没有任何动画,并且我的应用程序不再受阻.这样我的自动化时间从 25分钟减少到2分钟.
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.
这篇关于无法监控事件循环并等待应用程序空闲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!