Is it possible to run some tests or a logical flow before any suite in Protractor is run?
For example, I want to break up my Protractor tests into a series of suites for testing different aspects of my application. Let's say Jenkins is going to run the entire test suite before deployment, but individual developers will run only the suites pertinent to the work they're doing.
But I want most of my suites to be able to login to the application, and I'd rather not repeat that login logic in every suite. Is there a way to have a pre-suite test that does stuff like logging in before all tests are run?
I thought about just listing this where I'm defining my suites in my Protractor config like
suites: {
'my-profile': [
'./e2e/login/login-as-customer.e2e-spec.js',
'./e2e/my-profile/my-profile-change-password.e2e-spec.js',
'./e2e/my-profile/my-profile-change-username.e2e-spec.js'
],
'my-contacts': [
'./e2e/login/login-as-customer.e2e-spec.js',
'./e2e/my-contacts/add-contact.e2e-spec.js',
'./e2e/my-contacts/remove-contact.e2e-spec.js'
]
}
But the problem is I don't want it to have to relogin each time when we run the entire test suite together, or if a developer wants to run more than one suite together. What I need is a pre-suite step somehow.
Is this possible with Protractor?
beforeAll()in your specs to login? - Gunderson