mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
default login with admin if not to create user (#6260)
This commit is contained in:
@@ -39,6 +39,10 @@ export class UsersActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createUser(userModel?: UserModel): Promise<UserModel> {
|
async createUser(userModel?: UserModel): Promise<UserModel> {
|
||||||
|
if (!this.api.apiService.isLoggedIn()) {
|
||||||
|
await this.api.apiService.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
||||||
|
}
|
||||||
|
|
||||||
const user = new UserModel({ ...(userModel ? userModel : {}) });
|
const user = new UserModel({ ...(userModel ? userModel : {}) });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -99,7 +103,7 @@ export class UsersActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createUserWithName(firstName: string, lastName: string): Promise<UserModel> {
|
async createUserWithName(firstName: string, lastName: string): Promise<UserModel> {
|
||||||
const user = new UserModel({ firstName: firstName, lastName: lastName});
|
const user = new UserModel({ firstName: firstName, lastName: lastName });
|
||||||
return this.createUser(user);
|
return this.createUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user