Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Protractor - Leave browser open after E2E tests

Is it possible to leave the test browser windows open after Angular Protractor tests run? I have a tough test failing in FireFox and it'd be useful to access the state of the web page to see what's going on.

like image 871
BradGreens Avatar asked Apr 29 '14 19:04

BradGreens


People also ask

Does Angular still use Protractor?

Angular Team Announces End of Protractor Development By continuing to use Protractor, users may end up with disruptions in their automation scripts. However, the Protractor team has defined a timeline that gives users enough time to look into alternatives and migrate their tests accordingly.

How does Protractor wait for Angular?

For Angular apps, Protractor will wait until the Angular Zone stabilizes. This means long running async operations will block your test from continuing.

How do you invoke a Protractor browser?

Protractor provides a method called maximize(), which helps the user to maximize the browser window. import { browser} from 'protractor' describe('Protractor Typescript Demo', function() { it('title verifications', function() { browser. get('https://angularjs.org/'); browser. manage().


2 Answers

You can use Protractor debug/pause feature to pause the e2e run which will ultimately leave the browser open: more info here

To do so, add this line on your protractor test before the failing one

browser.pause(); 

There is also a very useful tool called elementor that you may want to take a look later on.

like image 163
Leo Gallucci Avatar answered Sep 23 '22 01:09

Leo Gallucci


browser.pause no longer works with current Node v8.1.0, see here, but you could use browser.sleep(10000); to keep the browser open for e.g. 10 seconds

like image 25
Urs Avatar answered Sep 24 '22 01:09

Urs