Saradha
Saradha

Reputation: 35

Will protractor afterEach not run a jasmine timeout happens?

I am new to protractor and any response helps!! I see this Message: timeout: timed out after 30000 msec waiting for spec to complete Stacktrace: undefined

and I have afterEach cleans my test data. My log messages there are not being printed. Seems like it does not run afterEach. Also will afterEach be called when a test test fails normally (without timeout but other error)? If yes, is there a way for me to check for test result being pass or fail and do some cleanup actions based on that?

Upvotes: 1

Views: 438

Answers (1)

P.T.
P.T.

Reputation: 25177

No, Jasmine does not execute the afterEach block in the case of a timeout.

You can see how to hook up some code to run when a Jasmine test fails in the Protractor FAQ: https://github.com/angular/protractor/blob/master/docs/faq.md#how-can-i-get-screenshots-of-failures

Upvotes: 1

Related Questions