Can protractor be made to run slowly? Can protractor be made to run slowly? angularjs angularjs

Can protractor be made to run slowly?


Below is my solution to do that. So basically I created a decorator for current control flow execute function, which now additionaly queues a delay of 100ms before each queued action.

This needs to be run before any tests are invoked (outside describe block)

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(100);  });  return origFn.apply(browser.driver.controlFlow(), args);};


Just like George Stocker said in the comment, I don't know why you would want to do this...but you can always add a sleep wherever you want in your test.

browser.sleep(6000);


You can enter in 'debug mode' by placing in your code the command:

browser.pause();

In the debug mode, you would see the following output in your terminal:

------- WebDriver Debugger -------readypress c to continue to the next webdriver commandpress d to continue to the next debugger statementtype "repl" to enter interactive modetype "exit" to break out of interactive modepress ^C to exit

You could then:

  • Run command by command by entering c
  • Continue to the next debugger statement (next browser.pause()) by entering d
  • Enter in interactive mode where you could interact with all the elements by entering repl