protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Sleep() or Pause() functionality

Open dgurjar22 opened this issue 13 years ago • 6 comments

Someway to make the Protractor sleep for the given amount of time, would be helpful to have in case of fast traversing pages, where not much activities are happening.

dgurjar22 avatar Jul 24 '13 20:07 dgurjar22

Protractor already supports this functionality, https://github.com/juliemr/protractor/issues/27#issuecomment-20837485

davemo avatar Jul 24 '13 20:07 davemo

I think this request is slightly different - this is for putting in pauses to allow activity to be observed, not just making sure the test doesn't time out too quickly.

I think a better way of putting this is "there should be a way to pause so one can interact with the site / debug". Angular scenario runner has this feature.

juliemr avatar Aug 07 '13 22:08 juliemr

OK - this is now enabled by starting with the command line protractor debug <conf.js> and adding ptor.debugger() in the code where you'd like to pause. See 7a594791b5ac6616de9c98dcd7d44ecaffb0e8a3 - more documentation coming soon!

juliemr avatar Aug 24 '13 00:08 juliemr

Documentation: https://github.com/angular/protractor/blob/master/docs/debugging.md

The ptor.debugger() method will be included in the 0.8.0 release later this week!

juliemr avatar Aug 28 '13 19:08 juliemr

The original request is for a way to insert a brief pause in the test, rather than a way to pause for debugging purposes.

For example, I have a controller which persists the innerHtml of a contentEditable element to indexedDb after each key stroke. There is a timing-dependence in my tests which sometimes causes the last typed letter not to be saved. I'd like to introduce a 10ms pause in the test to ensure that the save occurs.

edrex avatar Jan 22 '14 23:01 edrex

http://blog.activelylazy.co.uk/2012/01/29/testing-asynchronous-applications-with-webdriverwait/

this.

edrex avatar Jan 23 '14 00:01 edrex