Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 4e2da1a4 authored by Mihai BOZ's avatar Mihai BOZ
Browse files

Pull request #70: Removed step to close confirmation popup when password is changed.

Merge in EDELIVERY/smp from EDELIVERY-11824-Password-change-success-message-should-appear-in-a-green-alert to development

* commit '844b4e35':
  Removed step to close confirmation popup when password is changed.
parents c6a5ce6c 844b4e35
No related branches found
No related tags found
No related merge requests found
Pipeline #138282 failed
......@@ -46,8 +46,6 @@ public class SetChangePasswordDialog extends DComponent {
//wait.forElementToBeClickable(setPasswordBtn);
if (weToDButton(setPasswordBtn).isEnabled()) {
weToDButton(setPasswordBtn).click();
SuccesfullPasswordChangedPopup popup = new SuccesfullPasswordChangedPopup(driver);
popup.closePopup();
return new DomiSMPPage(driver);
} else {
return null;
......
package ddsl.enums;
public class Messages {
/**
* This class is used to add all the alert messages from application.
*/
public static final String PASSWORD_SUCCESSFULL_PASSWORD_CHANGED = "Password has been successfully set/changed. Login again to the application with the new password!";
}
......@@ -2,6 +2,7 @@ package domiSMPTests.ui;
import ddsl.DomiSMPPage;
import ddsl.dcomponents.SetChangePasswordDialog;
import ddsl.enums.Messages;
import ddsl.enums.Pages;
import domiSMPTests.SeleniumTest;
import org.testng.Assert;
......@@ -136,14 +137,17 @@ public class ProfilePgTests extends SeleniumTest {
setChangePasswordDialog.fillChangePassword(data.getNewPassword(), new40CharactersPasswordValue);
List<String> errors = setChangePasswordDialog.getFieldErrorMessage();
DomiSMPPage homepage = setChangePasswordDialog.TryClickOnChangePassword();
String sucesfullMessage = homepage.getAlertArea().getAlertMessage();
soft.assertEquals(sucesfullMessage, Messages.PASSWORD_SUCCESSFULL_PASSWORD_CHANGED);
soft.assertEquals(errors.size(), 0, "Could not change the password of the user");
soft.assertNotNull(homepage, "Could not change the password of the user");
soft.assertNotNull(homepage, "Homepage is not loaded. Could not change the password of the user");
soft.assertAll();
}
@Test(description = "PROF-04 User should be able to change his password")
public void userShouldBeAbleToChangeHisPassword() throws Exception {
public void
userShouldBeAbleToChangeHisPassword() throws Exception {
UserModel adminUser = UserModel.generateUserWithADMINrole();
rest.users().createUser(adminUser);
......@@ -155,10 +159,11 @@ public class ProfilePgTests extends SeleniumTest {
String newPass = "Edeltest!23456789Edelt" + Generator.randomAlphaNumericValue(4);
SetChangePasswordDialog setChangePasswordDialog = profilePage.profileData.clickOnChangePassword();
setChangePasswordDialog.fillChangePassword(data.getNewPassword(), newPass);
setChangePasswordDialog.fillChangePassword(data.getNewPassword(),
newPass);
homePage = setChangePasswordDialog.TryClickOnChangePassword();
soft.assertNotNull(homePage, "Could not change the password of the user");
String sucesfullMessage = homePage.getAlertArea().getAlertMessage();
soft.assertEquals(sucesfullMessage, Messages.PASSWORD_SUCCESSFULL_PASSWORD_CHANGED);
homePage.goToLoginPage();
loginPage.login(adminUser.getUsername(), newPass);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment