Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        public static DashBoardPage Login(LoginPage loginPage, String userName, String password)
        {
            loginPage.FillUserName(userName);
            loginPage.FillPassword(password);
            DashBoardPage dashBoardPage = loginPage.Submit();

            Assert.IsTrue(dashBoardPage.IsChangePasswordDisplayed(), "NO se mostro el link para cambio de contrasena");
            return(dashBoardPage);
        }
Exemplo n.º 3
0
        public void TestLoginValid2()
        {
            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");
        }
Exemplo n.º 4
0
        public void CreateUser()
        {
            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.IsAddUserLinkDisplayed(), "NO se mostro el boton de Add Users");

            authUserPage.FilterByStaffYesClick();
            authUserPage.FilterByStaffNoClick();
            authUserPage.FilterByStaffAllClick();

            AddUserPage addUserPage = authUserPage.AddUserClick();

            Assert.IsTrue(addUserPage.IsTitleDisplayed(), "No se mostro el titulo");

            addUserPage.FillUserName(ConfigurationManager.AppSettings["NEW_USER"]);
            addUserPage.FillPasswod1(ConfigurationManager.AppSettings["NEW_PASSWORD"]);
            addUserPage.FillPasswod2(ConfigurationManager.AppSettings["NEW_PASSWORD"]);
            ChangeUserPage changeUserPage = addUserPage.Submit();

            Assert.IsTrue(changeUserPage.IsTitleDisplayed(), "No se mostro el titulo");

            changeUserPage.CheckStaff();
            changeUserPage.CheckSuperuser();
            authUserPage = changeUserPage.Submit();

            Assert.IsTrue(authUserPage.IsUserLinkDisplayed(ConfigurationManager.AppSettings["NEW_USER"]), "No se mostro el nuevo usuario");
        }