Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Method for slowing down the tests #2986

Open
philoniare opened this issue Feb 29, 2016 · 7 comments
Open

Method for slowing down the tests #2986

philoniare opened this issue Feb 29, 2016 · 7 comments

Comments

@philoniare
Copy link

Reasons for adopting a new feature:
Protractor needs a method for specifying a delay between changing of each visual element so that QA engineers and other people not familiar with Protractor, can observe what is happening at each step. It is possible to enter manual browser.sleep() everywhere in your code, but for a few hundred lines of tests, it would mean a lot of code duplication. It would be great if we could just set a "speed factor" in the configuration and have the tests run in the browser in a reasonable speed that it can be observed by a third-party without knowledge of the code.

Is this a breaking change?
No, it would just be an additional optional functional that doesn't break anything.

[Edited to conform to feature request template]

@NickTomlin
Copy link
Contributor

Could you please update your request with the information for feature requests in the issue template?

I don't see how this is a dramatic improvement over browser.pause. You can also record your tests or use a service like SauceLabs that does something similar for you.

@philoniare
Copy link
Author

@NickTomlin Please see the revised version. Basically, as a developer we can definitely do browser.pause() to debug, but in a real-life situation where you would have to demo it to others, it is more convenient to have a version that automatically goes through each statement with delays in-between. If protractor doesn't want to offer an in-house solution, do you know how it could be done manually?

Thanks!

@Xotabu4
Copy link

Xotabu4 commented Mar 3, 2016

@philoniare you can record video and slow down playback instead

@Emilemuny
Copy link

var origFn = browser.driver.controlFlow().execute;
browser.driver.controlFlow().execute = function () {
var args = arguments;
// queue 100ms wait
origFn.call(browser.driver.controlFlow(), function () {
return protractor.promise.delayed(200);   // here we can adjust the execution speed
});
return origFn.apply(browser.driver.controlFlow(), args);
};

This code worked out for me, add it in your beforeEach and you'll notice protractor runs a little slower, allowing anyone to see what's happening :)

@juliemr
Copy link
Member

juliemr commented Jul 14, 2016

This might be a nice thing to include in Blocking Proxy @mgiambalvo

@heathkit
Copy link
Contributor

This should be covered by angular/blocking-proxy#14

@dixitgargi
Copy link

above provided cod is not working at my end getting below error:
TypeError: Cannot read property 'controlFlow' of undefined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants