Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default login with admin if not to create user e2e #6260

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/testing/src/lib/core/actions/users.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export class UsersActions {
}

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 : {}) });

try {
Expand Down Expand Up @@ -99,7 +103,7 @@ export class UsersActions {
}

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);
}

Expand Down