STOP! FREEZE! PAUSE! Here is a brief tip that might come useful while creating tests with Protractor.
If you haven’t update to the latest version, then you might want to. There is beta feature that allows you to stop the test execution so you can play around with your browser. (You can review latest changes in 0.21.0 here)
If you come from E2E tests with Karma you know how it goes and you were already missing this feature.
Long story short, in your tests you can now drop browser.pause() as many times as you want. Protractor will start execution and when it finds the pause command it will freeze right there.
This allows you to play with the application or site that you have programatically opened for the Spec you have written. You may open developer tools, take screenshots, take a look at source code, etc.
At your command line, you will see the following legend:
The verbiage is self explanatory. By typing ‘c’ or ‘d’ you basically handle the flow.
This is a beta status feature but feedback and pull requests become the best way to get it to the next stage.
If you liked this one, stay tuned for the next Protractor tip on elementExplorer.