用量角器测试AngularJS应用程序时禁用动画 [英] Disable animations when testing AngularJS app with protractor

查看:129
本文介绍了用量角器测试AngularJS应用程序时禁用动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些code在我AngularJS应用程序,它显示/隐藏动画,使用像一些div: $(EL).fadeOut()

I have some code in my AngularJS app which displays/hides some divs using animations like: $(el).fadeOut().

如何可以使用带量角器测试时禁用动画: http://api.jquery.com/jQuery.fx .off 的?我可以以某种方式从量角器直接运行在浏览器中那一小块Øcode?

How can I disable the animations when testing with protractor using: http://api.jquery.com/jQuery.fx.off ? Can I somehow run that small piece o code in the browser directly from protractor?

推荐答案

发现:

var ptor = protractor.getInstance();
ptor.get("http://localhost:9000/");
ptor.driver.executeScript("$.fx.off = true;");

这篇关于用量角器测试AngularJS应用程序时禁用动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆