Disable animations when testing AngularJS app with protractor

泪湿孤枕 提交于 2019-12-10 13:30:02

问题


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

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?


回答1:


Found it:

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


来源:https://stackoverflow.com/questions/18852713/disable-animations-when-testing-angularjs-app-with-protractor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!