我在GREYConfiguration中看到了下面的API,它说EarlGrey在默认情况下截断CALayer动画超过10秒-
/**
* Configuration for setting max allowable animation duration (in seconds) for any CALayer based
* animation. Animations exceeding the specified time will have their duration truncated to value
* specified by this config.
*
* Accepted values: @c double (negative values shouldn't be used)
* Default value: 10.0
*/
GREY_EXTERN NSString *const kGREYConfigKeyCALayerMaxAnimationDuration;我正在开发一个小游戏应用程序,有许多这样的动画正在进行。当我启用动画时,我注意到我的测试需要很长时间才能运行,这是UI测试所必需的。我知道,我可以改变我的整个应用程序的动画速度使用UIApplication.sharedApplication.keyWindow.layer.speed。我是否可以只为我的EarlGrey测试更改它?
发布于 2016-07-18 14:33:13
将UIApplication.sharedApplication.keyWindow.layer.speed放在条件语句后面:
#if EARLGREY_ENV
UIApplication.sharedApplication.keyWindow.layer.speed = 100
#endif这一行代码将只在应用程序通过伯爵格雷运行时才会执行。
有关处理伯爵灰色动画的更多信息,请参见如何处理动画?在他们的常见问题下。
https://stackoverflow.com/questions/38432252
复制相似问题