improved e2e login api (#6248)

* improved e2e login api

* throw error on missing profile
This commit is contained in:
Denys Vuika
2020-10-16 07:30:43 +01:00
committed by GitHub
parent 9d22f5505f
commit 217ae445c6
136 changed files with 409 additions and 408 deletions

View File

@@ -86,6 +86,19 @@ export class ApiService {
await this.apiService.login(username, password);
}
/**
* Login using one of the account profiles from the `browser.params.testConfig`.
* Example: loginWithProfile('admin')
*/
async loginWithProfile(profileName: string): Promise<void> {
const profile = browser.params.testConfig[profileName];
if (profile) {
await this.apiService.login(profile.email, profile.password);
} else {
throw new Error(`Login profile "${profileName}" not found on "browser.params.testConfig".`);
}
}
async performBpmOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.hostBpm + path;