redhead
redhead

Reputation: 1317

Jasmine helpers in Protractor

Jasmine offers way to run helper files before specs using its helpers option. I wanted to use a helper file to add a global beforeEach call, so all tests run this before they are started. But I somehow fail to find the way to do this using protractor (that uses Jasmine).

How can I add helpers option for jasmine in Protractor. Can I somewhere specify Jasmine's options?

Upvotes: 1

Views: 636

Answers (1)

alecxe
alecxe

Reputation: 473803

According to the documentation, helpers scripts are executed before the specs. In protractor, this is what onPrepare() function is responsible for. Here is a sample onPrepare() function that logs into the application before any specs were executed.

Also, here is a relevant topic on the subject of sharing the beforeEach() setup across specs:

Upvotes: 2

Related Questions