2

In using protractor, I've found browser.debugger() and the element explorer hugely useful.

What I'd like to do with tests that require more setup is pause execution with the debugger and enter a REPL similar to the element explorer.

I can get really close by dropping into a repl. It finds elements but actions like click or sendKeys don't seem to work. This may be a limitation of the node debugger and the way it pauses execution.

debug> repl
Press Ctrl + C to leave debug repl
> $('#project_name').sendKeys('hello world').then(function() { console.log('finished') })
{ then: [Function],
  cancel: [Function],
  isPending: [Function] }
> 

Does anyone know of a way to test out element.click and element.sendKeys and friends from a browser.debugger breakpoint?

Neil Sarkar
  • 6,834
  • 8
  • 32
  • 30
  • I created a project called elementor which is based on the element explorer. I am looking for feedback. Let me know if it works for you https://www.npmjs.org/package/elementor – Andres D Nov 26 '14 at 00:55
  • 1
    We'd love to be able to do this and are working on it in Protractor, but it's not available yet. Stay tuned to the changelog! – Jmr Dec 03 '14 at 21:57
  • You'll be able to do it by next release: https://github.com/angular/protractor/pull/1607 – hankduan Dec 09 '14 at 01:57

1 Answers1

1

This feature is in master now. See https://github.com/angular/protractor/commit/4368842da73d4ed501df21b61daf71951e59524b and https://github.com/angular/protractor/pull/1607. You can either use master to make use of this or wait for protractor 1.6.0

hankduan
  • 5,994
  • 1
  • 29
  • 43