In protractor, there is the browser.pause()
function:
Beta (unstable)
pause
function for debugging webdriver tests. Use
browser.pause() in your test to enter the protractor debugger from
that point in the control flow.
element(by.id('foo')).click();
browser.pause();
// Execution will stop before the next click action.
element(by.id('bar')).click();
And, also, there is a less-known one - browser.enterRepl()
:
Beta (unstable)
enterRepl
function for entering the repl loop from any
point in the control flow. Use browser.enterRepl() in your test. Does
not require changes to the command line (no need to add 'debug').
element(by.id('foo')).click();
browser.enterRepl();
// Execution will stop before the next click action.
element(by.id('bar')).click();
From the provided documentation and examples, it is clear that they both are used for debugging the tests. But, it is not clear, what is the difference between the two.
When should we use pause()
and when enterRepl()
?