Skip to content

Commit

Permalink
fix change password functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
legrego committed Apr 2, 2019
1 parent 8a5e256 commit fff9fe4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ export class ChangePasswordForm extends Component<Props, State> {
};

private handleChangePasswordSuccess = () => {
toastNotifications.addSuccess(
i18n.translate('xpack.security.account.changePasswordSuccess', {
toastNotifications.addSuccess({
text: i18n.translate('xpack.security.account.changePasswordSuccess', {
defaultMessage: 'Your password has been changed',
})
);
}),
'data-test-subj': 'passwordUpdateSuccess',
});

this.setState({
currentPasswordError: false,
shouldValidate: false,
Expand Down
9 changes: 4 additions & 5 deletions x-pack/test/functional/page_objects/accountsetting_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ export function AccountSettingProvider({ getService }) {
}

async changePassword(currentPassword, newPassword) {
await testSubjects.click('changePasswordLink');
await testSubjects.setValue('newPasswordInput', newPassword);
await testSubjects.setValue('currentPasswordInput', currentPassword);
await testSubjects.setValue('confirmPasswordInput', newPassword);
await testSubjects.click('saveChangesButton');
await testSubjects.setValue('currentPassword', currentPassword);
await testSubjects.setValue('newPassword', newPassword);
await testSubjects.setValue('confirmNewPassword', newPassword);
await testSubjects.click('changePasswordButton');
await testSubjects.existOrFail('passwordUpdateSuccess');
}
}
Expand Down

0 comments on commit fff9fe4

Please sign in to comment.