To debug any test spec, we must pause the test process and see what is going on step-by-step. Protractor also has built-in methods to pause the process. Here are two methods to pause and debug the test process:
browser.pause()
browser.debugger()
Debugging Protractor tests becomes easy and simple with the browser.pause()
command. Using the pause()
method, we can enter the Protractor debugger control flow and execute some commands to check out what's happening in the control flow of the test. Mostly, developers use debuggers in tests when the test fails with an unknown error and there are long error messages.
After using the browser.pause()
command, we can use a few more commands based on our needs.
Let's take a brief look:
c
: If we typec
as a command, it will move one step forward in the test, and we will see how the test command works in depth. If we plan to move forward with a test, it's better to do it quickly as there is a timeout issue ( the Jasmine default...