예제 #1
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");
        }
예제 #2
0
        public static void CreateUser(LoginPage loginPage, String userName, String password, String newUser, String newPassword, Boolean checkStaff, Boolean checkSuperuser)
        {
            // llenar el formulario de login
            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.IsAddUserLinkDisplayed(), "NO se mostro el boton de Add Users");

            AddUserPage addUserPage = authUserPage.AddUserClick();

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

            addUserPage.FillUserName(newUser);
            addUserPage.FillPasswod1(newPassword);
            addUserPage.FillPasswod2(newPassword);
            ChangeUserPage changeUserPage = addUserPage.Submit();

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

            if (checkStaff)
            {
                changeUserPage.CheckStaff();
            }
            if (checkSuperuser)
            {
                changeUserPage.CheckSuperuser();
            }
            authUserPage = changeUserPage.Submit();

            Assert.IsTrue(authUserPage.IsUserLinkDisplayed(newUser), "No se mostro el nuevo usuario");
            LoginCommons.Logout(authUserPage);
        }