예제 #1
0
  // To verify that user should not be allowed when user enters the invalid values in old and
  // confirm password textfields[TC-7]
  @Test(groups = "Module4", priority = 7)
  public void testvalidateInvalidMismatchNewAndCofirmPasswordWithInvalidOldPass() throws Exception {
    // >>>>>> Data Provider <<<<<<<< //
    String userName = ExcelReader.getValue("UserName");
    String passWord = ExcelReader.getValue("Password");
    String oldPassword = ExcelReader.getValue("OldPasswordValue_InValid");
    String newPassword = ExcelReader.getValue("NewPasswordValue_Valid");
    String confirmPassword = ExcelReader.getValue("ConfirmPassword_NotMatch");
    String newPasswordsMismatch = ExcelReader.getValue("NewAndConfirmPassword_Mismatch_Error");
    String errorMessages[] = {newPasswordsMismatch};

    // >>>>>> Methods <<<<<<< //
    LoginPage loginPage = new LoginPage();
    ChangePasswordPage changePassword = new ChangePasswordPage();
    loginPage.gotoLoginOrRegisterMenu(driver);
    loginPage.clickAlreadyRegisteredLink(driver);
    loginPage.loginToTrendInAccount(driver, userName, passWord);
    loginPage.gotoMyAccountPage(driver);
    changePassword.gotoChangePasswordPageAndValidate(driver, userName);
    changePassword.validateErrorMessageForChangePassword(
        driver, oldPassword, newPassword, confirmPassword, errorMessages);
  }
예제 #2
0
  // To verfiy the validation message when user enter invalid data in new and confirm password
  // textfield[TC-4]
  @Test(groups = "Module4", priority = 4)
  public void testValidateErrorMessageForPasswordTextfieldsBothNull() throws Exception {
    // >>>>>> Data Provider <<<<<<<< //
    String oldPassword = ExcelReader.getValue("OldPasswordValue");
    String newPassword = ExcelReader.getValue("NewPasswordValue_Null");
    String confirmPassword = ExcelReader.getValue("ConfirmPassword_Null");
    String newPasswordErrorWhenNull = ExcelReader.getValue("NewPasswordValue_Null_Error");
    String confirmPasswordErrorWhenNull = ExcelReader.getValue("ConfirmPassword_Null_Error");
    String errorMessages[] = {newPasswordErrorWhenNull, confirmPasswordErrorWhenNull};

    // >>>>>> Methods <<<<<<< //
    LoginPage loginPage = new LoginPage();
    ChangePasswordPage changePassword = new ChangePasswordPage();
    loginPage.gotoLoginOrRegisterMenu(driver);
    loginPage.clickAlreadyRegisteredLink(driver);
    String userName = ExcelReader.getValue("UserName");
    String passWord = ExcelReader.getValue("Password");
    loginPage.loginToTrendInAccount(driver, userName, passWord);
    loginPage.gotoMyAccountPage(driver);
    changePassword.gotoChangePasswordPageAndValidate(driver, userName);
    changePassword.validateErrorMessageForChangePassword(
        driver, oldPassword, newPassword, confirmPassword, errorMessages);
  }