예제 #1
0
        public void FilterTest()
        {
            String    usuario1  = "USUARIO1";
            String    usuario2  = "USUARIO2";
            LoginPage loginPage = new LoginPage(this.Driver);

            UserCommons.CreateUser(
                loginPage,
                ConfigurationManager.AppSettings["USERNAME"],
                ConfigurationManager.AppSettings["PASSWORD"],
                usuario1,
                "h9-Q)F5-59!N>nZC",
                true,//Con Staff
                true);
            UserCommons.CreateUser(
                loginPage,
                ConfigurationManager.AppSettings["USERNAME"],
                ConfigurationManager.AppSettings["PASSWORD"],
                usuario2,
                "L!JJKA<PYB4eP@u9",
                false,//Sin Staff
                true);

            DashBoardPage dashBoardPage = LoginCommons.Login(
                loginPage,
                ConfigurationManager.AppSettings["USERNAME"],
                ConfigurationManager.AppSettings["PASSWORD"]);
            AuthUserPage authUserPage = dashBoardPage.UsersLinkClick();

            authUserPage.FilterByStaffYesClick();
            Assert.IsTrue(authUserPage.IsStaffStatusIconDisplayed(usuario1, "True"), "NO se mostro el icono de Staff verde");
            authUserPage.FilterByStaffNoClick();
            Assert.IsTrue(authUserPage.IsStaffStatusIconDisplayed(usuario2, "False"), "NO se mostro el icono de Staff rojo");
            authUserPage.FilterByStaffAllClick();
            Assert.IsTrue(authUserPage.IsStaffStatusIconDisplayed(usuario1, "True"), "NO se mostro el icono de Staff verde");
            Assert.IsTrue(authUserPage.IsStaffStatusIconDisplayed(usuario2, "False"), "NO se mostro el icono de Staff rojo");

            LoginCommons.Logout(authUserPage);

            UserCommons.DeleteUser(
                loginPage,
                ConfigurationManager.AppSettings["USERNAME"],
                ConfigurationManager.AppSettings["PASSWORD"],
                usuario1);
            UserCommons.DeleteUser(
                loginPage,
                ConfigurationManager.AppSettings["USERNAME"],
                ConfigurationManager.AppSettings["PASSWORD"],
                usuario2);
        }
예제 #2
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");
        }