Giovanni Bitliner
Giovanni Bitliner

Reputation: 2072

Is there a way to stop protractor after it throws a timeout exception?

Quite often there is the chance that protractor test specs throws a timeout exception.

To make debugging and troubleshooting easier, I would like to stop protractor just after a timeout exception and prevent it to continue running test.

But trying to catch timeout exception at each promise looks quite ugly to do.

Is there any other way to stop protractor when it throws a timeout exception?

Upvotes: 3

Views: 667

Answers (2)

Linh Pham
Linh Pham

Reputation: 3025

Another option will be protractor-fail-fast Only in case jasmine-fail-fast doesn't work for you.

This Protractor plugin is essentially a wrapper around jasmine-fail-fast, solving the problem of halting multiple Protractor instances once one of them has failed. Otherwise, a multi-capability Protractor test will take as long as the longest running test instance, potentially as long as if jasmine-fail-fast wasn't applied at all.

Upvotes: 2

alecxe
alecxe

Reputation: 473763

One option would be to let jasmine exit on the first failure via jasmine-fail-fast:

Allow Jasmine tests to "fail-fast", exiting on the first failure instead of running all tests no matter what. This can save a great deal of time running slow, expensive tests, such as Protractor e2e tests.

Upvotes: 1

Related Questions