Ejemplo n.º 1
0
        public void OutofRangeDependent()
        {
            AddEmployeeDialogBox         addEmp    = new AddEmployeeDialogBox(driver);
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);
            dashboard.AddEmployeeButton.Click();

            try
            {
                Actions.AddEmployee(Config.EmployeeInfo.OutofRangeDependentInfo.FirstName, Config.EmployeeInfo.OutofRangeDependentInfo.LastName, Config.EmployeeInfo.OutofRangeDependentInfo.NumberOfDependents, driver);
                addEmp.CancelButton.Click();
                Thread.Sleep(2000);
                dashboard.LogOutLink.Click();
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
                addEmp.CancelButton.Click();
                Thread.Sleep(2000);
                dashboard.LogOutLink.Click();
            }

            Thread.Sleep(3000);
        }
Ejemplo n.º 2
0
        public void InvalidCredentials()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);
            LogInPage logIn = new LogInPage(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Invalid.Username.SpecialCharUserName, Config.Credentials.Invalid.Password.NumericPassword, driver);
            Assert.AreEqual(logIn.LoginErrorMessage.Text, "There were one or more problems that prevented you from logging in:");
            Assert.AreEqual(logIn.InvalidCredentialErrorMessage.Text, "The specified username or password is incorrect.");
        }
Ejemplo n.º 3
0
        public void ValidCredentials()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);

            //Thread.Sleep(5000);
            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);

            Assert.AreEqual(dashboard.EmployeeDashboardPageHeader.Text, "Paylocity Benefits Dashboard");
            Assert.AreEqual(dashboard.LogOutLink.Text, "Log Out");
            Assert.AreEqual(dashboard.IdColumnHeader.Text, "Id");
        }
Ejemplo n.º 4
0
        public void BlankCredentials()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);
            LogInPage logIn = new LogInPage(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Invalid.Username.BlankUserName, Config.Credentials.Invalid.Password.BlankPassword, driver);

            Assert.AreEqual(logIn.LoginErrorMessage.Text, "There were one or more problems that prevented you from logging in:");
            String text1 = logIn.UsernameRequiredErrorMessage.Text;

            Assert.AreEqual(logIn.UsernameRequiredErrorMessage.Text, "The Username field is required.");
            Assert.AreEqual(logIn.PasswordRequiredErrorMessage.Text, "The Password field is required.");
        }
Ejemplo n.º 5
0
        public void DashboardCoulmnHeaderValiadtion()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);

            Assert.AreEqual(dashboard.IdColumnHeader.Text, "Id");
            Assert.AreEqual(dashboard.LastNameColumnHeader.Text, "Last Name");
            Assert.AreEqual(dashboard.FirstNameColumnHeader.Text, "First Name");
            Assert.AreEqual(dashboard.DependentsColumnHeader.Text, "Dependents");
            Assert.AreEqual(dashboard.SalaryColumnHeader.Text, "Salary");
            Assert.AreEqual(dashboard.GrossPayColumnHeader.Text, "Gross Pay");
            Assert.AreEqual(dashboard.BenifitsCostColumnHeader.Text, "Benefits Cost");
            Assert.AreEqual(dashboard.NetPayColumnHeader.Text, "Net Pay");
            Assert.AreEqual(dashboard.ActionsColumnHeader.Text, "Actions");
        }
        public void DeleteEmployeeDialogboxLayoutValidation()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);
            DeleteEmployeeDialogBox      delEmp    = new DeleteEmployeeDialogBox(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);

            int    countOfLastNames = dashboard.LastNameList.Count;
            string DeleteLastName   = "Halpert";
            string existingLastName = "";
            int    i;

            try
            {
                for (i = 0; i <= countOfLastNames; i++)
                {
                    existingLastName = dashboard.FirstNameList[i].Text;
                    if (existingLastName == DeleteLastName)
                    {
                        dashboard.DeleteActionList[i].Click();


                        Assert.AreEqual(delEmp.DeleteEmployeeHeader.Text, "Delete Employee");

                        Assert.IsTrue(delEmp.DeleteButton.Displayed);

                        Assert.IsTrue(delEmp.CancelButton.Displayed);

                        Assert.IsTrue(delEmp.CrossButton.Displayed);
                        delEmp.CancelButton.Click();
                        break;
                    }
                }
            }
            catch (Exception)
            {
                delEmp.CancelButton.Click();
            }
        }
        public void AddEmployeeDialogBoxDisplayValidation()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);
            UpdateEmployeeDialogBox      updateEmp = new UpdateEmployeeDialogBox(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);
            dashboard.AddEmployeeButton.Click();
            try
            {
                Assert.IsTrue(updateEmp.UpdateEmployeeDialogBoxHeader.Displayed);
                Assert.AreEqual(updateEmp.UpdateEmployeeDialogBoxHeader.Text, "Update Employee");

                Assert.IsTrue(updateEmp.FirstNameLabel.Displayed);
                Assert.AreEqual(updateEmp.FirstNameLabel.Text, "First Name:");

                Assert.IsTrue(updateEmp.LastNameLabel.Displayed);
                Assert.AreEqual(updateEmp.LastNameLabel.Text, "Last Name:");

                Assert.IsTrue(updateEmp.DependentsLabel.Displayed);
                Assert.AreEqual(updateEmp.DependentsLabel.Text, "Dependents");

                Assert.IsTrue(updateEmp.UpdateButton.Displayed);
                Assert.AreEqual(updateEmp.UpdateButton.Text, "Add");

                Assert.IsTrue(updateEmp.CancelButton.Displayed);
                Assert.AreEqual(updateEmp.CancelButton.Text, "Cancel");

                Assert.IsTrue(updateEmp.CrossButton.Displayed);
            }
            catch (Exception)
            {
                updateEmp.CancelButton.Click();
                Thread.Sleep(2000);
                dashboard.LogOutLink.Click();
            }
        }
        public void ValidateUpdateEmployeeInfo()
        {
            AddEmployeeDialogBox         addEmp    = new AddEmployeeDialogBox(driver);
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);

            //Get count before adding an employee
            int countOfLastNames  = dashboard.LastNameList.Count;
            int countOfFirstNames = dashboard.FirstNameList.Count;
            int countOfDependents = dashboard.DependentsList.Count;
            int i;

            string UpdateFirstName = "Mike";
            string UpdateLastName  = "Scott";

            string  existingFirstName = "";
            string  existingLastName  = "";
            string  existingDependent = "";
            string  existingID;
            string  Id;
            int     j;
            int     dependents;
            decimal BenifitsCost;
            decimal NetPay;
            string  updatedFirstName  = Config.EmployeeInfo.UpdateEmployeeInfo.FirstName;
            string  updatedLastName   = Config.EmployeeInfo.UpdateEmployeeInfo.LastName;
            string  updatedDependents = Config.EmployeeInfo.UpdateEmployeeInfo.NumberOfDependents;

            try
            {
                for (i = 0; i <= countOfLastNames; i++)
                {
                    existingLastName = dashboard.FirstNameList[i].Text;
                    if (existingLastName == UpdateLastName)
                    {
                        existingFirstName = dashboard.LastNameList[i].Text;
                        if (existingFirstName == UpdateFirstName)
                        {
                            existingDependent = dashboard.DependentsList[i].Text;
                            if (existingDependent == "2")
                            {
                                dashboard.EditActionList[i].Click();
                                Actions.UpdateEmployee(Config.EmployeeInfo.UpdateEmployeeInfo.FirstName, Config.EmployeeInfo.UpdateEmployeeInfo.LastName, Config.EmployeeInfo.UpdateEmployeeInfo.NumberOfDependents, driver);
                                Id = dashboard.IdList[i].Text;

                                for (j = 0; j <= countOfLastNames; j++)
                                {
                                    existingLastName = dashboard.FirstNameList[j].Text;
                                    if (existingLastName == updatedLastName)
                                    {
                                        existingFirstName = dashboard.LastNameList[i].Text;
                                        if (existingFirstName == updatedFirstName)
                                        {
                                            existingDependent = dashboard.DependentsList[i].Text;
                                            if (existingDependent == updatedDependents)
                                            {
                                                existingID = dashboard.IdList[i].Text;
                                                if (Id == existingID)
                                                {
                                                    Assert.IsTrue(true);
                                                    dependents   = Int32.Parse(updatedDependents);
                                                    BenifitsCost = Actions.BenifitCalculation(dependents, driver);
                                                    string CalBenifitCost = BenifitsCost.ToString();
                                                    Assert.AreEqual(CalBenifitCost, dashboard.BenefitsCostList[i].Text);
                                                    NetPay = Actions.NetPayCalcualtion(BenifitsCost, driver);
                                                    string CalNetPay = NetPay.ToString();
                                                    Assert.AreEqual(CalNetPay, dashboard.NetPayList[i].Text);
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                dashboard.LogOutLink.Click();
            }
        }
        public void ValidateDeleteEmployee()
        {
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);
            DeleteEmployeeDialogBox      delEmp    = new DeleteEmployeeDialogBox(driver);

            //Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);

            //Get count before adding an employee
            int    countOfLastNames  = dashboard.LastNameList.Count;
            int    countOfFirstNames = dashboard.FirstNameList.Count;
            int    countOfDependents = dashboard.DependentsList.Count;
            int    i;
            string existingFirstName = "";
            string existingLastName  = "";
            string existingDependent = "";

            string DeleteFirstName = "Jim";
            string DeleteLastName  = "Halpert";
            string DeleteDependent = "4";
            string ID;
            int    j;
            string searchID;

            try
            {
                for (i = 0; i <= countOfLastNames; i++)
                {
                    existingLastName = dashboard.FirstNameList[i].Text;
                    if (existingLastName == DeleteLastName)
                    {
                        existingFirstName = dashboard.LastNameList[i].Text;
                        if (existingFirstName == DeleteFirstName)
                        {
                            existingDependent = dashboard.DependentsList[i].Text;
                            if (existingDependent == DeleteDependent)
                            {
                                ID = dashboard.IdList[i].Text;
                                dashboard.DeleteActionList[i].Click();
                                Actions.DeleteEmployee(ID, driver);

                                for (j = 0; j <= countOfLastNames; j++)
                                {
                                    searchID = dashboard.IdList[i].Text;
                                    if (searchID == ID)
                                    {
                                        Assert.IsTrue(false);
                                    }
                                    else
                                    {
                                        Assert.IsTrue(true);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                dashboard.LogOutLink.Click();
            }
        }
Ejemplo n.º 10
0
        public void ValidateAddedValidEmployee()
        {
            AddEmployeeDialogBox         addEmp    = new AddEmployeeDialogBox(driver);
            EmployeeBenifitDashboardPage dashboard = new EmployeeBenifitDashboardPage(driver);

            Actions.LoginToEmployeeBenifitDashboard(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, driver);

            //Get count before adding an employee
            int countOfLastNames  = dashboard.LastNameList.Count;
            int countOfFirstNames = dashboard.FirstNameList.Count;
            int countOfDependents = dashboard.DependentsList.Count;


            dashboard.AddEmployeeButton.Click();
            string fntext  = Config.EmployeeInfo.ValidEmployeeInfo.FirstName;
            string lntext  = Config.EmployeeInfo.ValidEmployeeInfo.LastName;
            string deptext = Config.EmployeeInfo.ValidEmployeeInfo.NumberOfDependents;

            Actions.AddEmployee(Config.EmployeeInfo.ValidEmployeeInfo.FirstName, Config.EmployeeInfo.ValidEmployeeInfo.LastName, Config.EmployeeInfo.ValidEmployeeInfo.NumberOfDependents, driver);

            Thread.Sleep(3000);

            int countofLastNameafterAddition  = dashboard.LastNameList.Count;
            int countOfFirstNameafterAddition = dashboard.FirstNameList.Count;

            countOfFirstNames = countOfFirstNames + 1;
            countOfLastNames  = countOfLastNames + 1;

            Assert.AreEqual(countOfFirstNameafterAddition, countOfFirstNames);

            Assert.AreEqual(countofLastNameafterAddition, countOfLastNames);
            string  addedFirstName = "";
            string  addedLastName  = "";
            string  addedDependent = "";
            int     i;
            int     dependents;
            decimal BenifitsCost;
            decimal NetPay;

            for (i = 0; i <= countOfLastNames; i++)
            {
                addedFirstName = dashboard.LastNameList[i].Text;



                if (fntext == addedFirstName)
                {
                    addedLastName = dashboard.FirstNameList[i].Text;
                    if (lntext == addedLastName)
                    {
                        addedDependent = dashboard.DependentsList[i].Text;
                        if (deptext == addedDependent)
                        {
                            Assert.IsTrue(true);
                            dependents   = Int32.Parse(addedDependent);
                            BenifitsCost = Actions.BenifitCalculation(dependents, driver);
                            string CalBenifitCost = BenifitsCost.ToString();
                            Assert.AreEqual(CalBenifitCost, dashboard.BenefitsCostList[i].Text);
                            NetPay = Actions.NetPayCalcualtion(BenifitsCost, driver);
                            string CalNetPay = NetPay.ToString();
                            Assert.AreEqual(CalNetPay, dashboard.NetPayList[i].Text);
                            break;
                        }
                    }
                }
            }

            Thread.Sleep(3000);
        }