public static void ChangePassword(LoginPage loginPage, String userName, String password, String newUser, String changePassword) { DashBoardPage dashBoardPage = LoginCommons.Login(loginPage, userName, password); Assert.IsTrue(dashBoardPage.IsUsersLinkDisplayed(), "NO se mostro el link de Users"); AuthUserPage authUserPage = dashBoardPage.UsersLinkClick(); Assert.IsTrue(authUserPage.IsTitleDisplayed(), "NO se mostro el titulo"); Assert.IsTrue(authUserPage.IsUserLinkDisplayed(newUser), "NO se mostro el link del usuario"); ChangeUserPage changeUserPage = authUserPage.UserLinkClick(newUser); Assert.IsTrue(changeUserPage.IsChangePasswordLinkDisplayed(), "No se mostro el link para cambiar la clave"); ChangePasswordPage changePasswordPage = changeUserPage.ChangePasswordClick(); Assert.IsTrue(changePasswordPage.IsPassword1Displayed(), "No se mostro el campo Password1"); Assert.IsTrue(changePasswordPage.IsPassword2Displayed(), "No se mostro el campo Password2"); changePasswordPage.FillPassword1(changePassword); changePasswordPage.FillPassword2(changePassword); changeUserPage = changePasswordPage.Submit(); Assert.IsTrue(changeUserPage.IsTitleDisplayed(), "No se mostro el titulo"); LoginCommons.Logout(changeUserPage); }
public void ChangePassword() { LoginPage loginPage = new LoginPage(this.Driver); loginPage.FillUserName(ConfigurationManager.AppSettings["USERNAME"]); loginPage.FillPassword(ConfigurationManager.AppSettings["PASSWORD"]); DashBoardPage dashBoardPage = loginPage.Submit(); Assert.IsTrue(dashBoardPage.IsLogOutDisplayed(), "Logout link not displayed"); Assert.IsTrue(dashBoardPage.IsChangePasswordDisplayed(), "Change password link not displayed"); AuthUserPage authUserPage = dashBoardPage.UsersLinkClick(); Assert.IsTrue(authUserPage.IsTitleDisplayed(), "NO se mostro el titulo"); Assert.IsTrue(authUserPage.IsUserLinkDisplayed(ConfigurationManager.AppSettings["NEW_USER"]), "NO se mostro el link del usuario"); ChangeUserPage changeUserPage = authUserPage.UserLinkClick(ConfigurationManager.AppSettings["NEW_USER"]); Assert.IsTrue(changeUserPage.IsChangePasswordLinkDisplayed(), "No se mostro el link para cambiar la clave"); ChangePasswordPage changePasswordPage = changeUserPage.ChangePasswordClick(); Assert.IsTrue(changePasswordPage.IsPassword1Displayed(), "No se mostro el campo Password1"); Assert.IsTrue(changePasswordPage.IsPassword2Displayed(), "No se mostro el campo Password2"); changePasswordPage.FillPassword1(ConfigurationManager.AppSettings["CHANGE_PASSWORD"]); changePasswordPage.FillPassword2(ConfigurationManager.AppSettings["CHANGE_PASSWORD"]); changeUserPage = changePasswordPage.Submit(); Assert.IsTrue(changeUserPage.IsTitleDisplayed(), "No se mostro el titulo"); }