kamilkp
kamilkp

Reputation: 9800

protractor fail test if client yields error

I am writing e2e tests with angularJS and protractor. I would like to detect when a client script yielded and error. I would like my test case to fail then. How can i accomplish that? I'm not talking about custom thrown exceptions, but exceptions like: "cannot read property some_property of undefined".

Upvotes: 4

Views: 634

Answers (1)

hankduan
hankduan

Reputation: 6034

FYI this is the relevant issue: https://github.com/angular/protractor/issues/499

As of now, it's not possible. You may look into https://github.com/goodeggs/jasmine-bail-fast or if you're using mocha the --bail option. However, I have no experience with either of those.

Upvotes: 1

Related Questions