Disable animations when testing AngularJS app with

2019-06-19 01:16发布

问题:

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;");