mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
improved e2e login api (#6248)
* improved e2e login api * throw error on missing profile
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user