Exemplo n.º 1
0
        public void TC07_UserChangePassword()
        {
            Console.WriteLine("TC07 - User can change password");

            //1. Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2. Login with valid account
            LoginPage loginPage = homePage.GoToLoginPage();

            homePage = loginPage.Login(Constant.ValidUsername, Constant.ValidPassword);

            //3. Click on "Change Password" tab
            ChangePasswordPage changePasswordPage = homePage.GoToChangePasswordPage();

            //4. Enter valid value into all fields.
            //5. Click on "Change Password" button
            //VP. Message "Your password has been updated" appears.
            string newPassword = "******";
            string actualMsg   = changePasswordPage.ChangePassword(Constant.ValidPassword, newPassword, newPassword).GetSuccessMessage();
            string expectedMsg = "Your password has been updated!";

            Assert.AreEqual(expectedMsg, actualMsg);

            //Post-condition: Change password to the old one
            changePasswordPage.ChangePassword(newPassword, Constant.ValidPassword, Constant.ValidPassword);
        }
Exemplo n.º 2
0
        public void TC08_UserCannotChangePassword()
        {
            Console.WriteLine("TC08 - User can't change password when 'New Password' and 'Confirm Password' are different.");

            //1. Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2. Login with valid account
            LoginPage loginPage = homePage.GoToLoginPage();

            homePage = loginPage.Login(Constant.ValidUsername, Constant.ValidPassword);

            //3. Click on "Change Password" tab
            ChangePasswordPage changePasswordPage = homePage.GoToChangePasswordPage();

            //4. Enter valid information into "Current Password" textbox but enter "a123:"/{}!@$\" into "New Password" textbox and "b456:"/{}!@$\" into "Confirm Password" textbox.
            //5. Click on "Change Password" button
            //VP. Error message "Password change failed. Please correct the errors and try again." appears.
            string newPassword     = "******"/{}!@$\\";
            string confirmPassword = "******"/{}!@$\\";
            string actualMsg       = changePasswordPage.ChangePassword(Constant.ValidPassword, newPassword, confirmPassword).GetSuccessMessage();
            string expectedMsg     = "Password change failed. Please correct the errors and try again.";

            Assert.AreEqual(expectedMsg, actualMsg);
        }
Exemplo n.º 3
0
        public void TryToChangePassword_NotMatchingPassword_ShouldNotUpdate()
        {
            var homepage       = LogIntoApp();
            var changePassword = new ChangePasswordPage(_driver, _url);

            changePassword.GoToPage();
            changePassword.ChangePassword(LogonUser.Password, "aaa", "bbb");
            var result = changePassword.ErrorValidationResponse();

            result.Should().Contain("The new password and confirmation password do not match.");
        }
Exemplo n.º 4
0
        public void CheckThePasswordIsChanged()
        {
            var email            = "Katy" + DateTime.Now.Ticks + "@abv.bg";
            var registrationPage = new RegistrationPage(this.driver);
            var registrationUser = new RegisterUser(email, "Katy Perry", "0123456789", "0123456789");

            registrationPage.NavigateTo();

            registrationPage.FillRegistrationForm(registrationUser);

            var changePasswordPage = new ChangePasswordPage(this.driver);
            var newPassword        = new Password("0123456789", "9876543210", "9876543210");

            changePasswordPage.ChangePassword(newPassword);

            changePasswordPage.AssertPasswordIsChange("Your password has been changed.");
        }
        public void PasswordChange()
        {
            //Starting Extent report
            ReportHelpers.test = ReportHelpers.extent.StartTest("Password Change");

            //Created object to interact with HomePage and SignInPage classes and their methods
            HomePage   HomePageObj   = new HomePage();
            SignInPage SignInPageObj = new SignInPage();

            //Called objects to run methods of these classes
            HomePageObj.Open();
            HomePageObj.OpenLoginForm();
            SignInPageObj.LogInSteps();

            //Created object to interact with ChangePasswordPage class and its methods
            ChangePasswordPage ChangePasswordPageObj = new ChangePasswordPage();

            //Called object to run ChangePassword method
            ChangePasswordPageObj.ChangePassword();
            ChangePasswordPageObj.PasswordChangeValidation();
        }
Exemplo n.º 6
0
        public void WhenIProvideTheValueForFieldsAnd(string OldPassword, string NewPassword, string ConfirmPassword)
        {
            ChangePasswordPage changePassword = new ChangePasswordPage();

            changePassword.ChangePassword(OldPassword, NewPassword, ConfirmPassword);
        }
Exemplo n.º 7
0
        public void WhenIReuseMyCurrentPassword()
        {
            var currentPassword = Base.TestBase.Credentials.Password;

            changePasswordPage.ChangePassword(currentPassword, currentPassword, currentPassword);
        }