Klinki
Klinki

Reputation: 1439

Protractor code shared among several test suits

I'm working with protractor (in combination with Jasmine) and I would like to test application which requires login. I tried to search here and I have found one solution which suggested to put login code into beforeEach method on test suite. Isn't there any other way? I will test lets say 20 pages, so I need to login only once, at the beginning of the testing. Not before each test suite.

Upvotes: 2

Views: 306

Answers (1)

Brine
Brine

Reputation: 3731

You can put your login in an onPrepare function, in your config file, that will get run once before any of your test runs. See the example withLoginConf.js

Upvotes: 2

Related Questions