示例#1
0
        public void salesAgentsAdvanceFilterResultsPP()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var agent_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

            try
            {
                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Redirect at employee page.");
                VisitOffice("sales_agents");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on advance filter.");
                agent_1099SalesAgentHelper.ClickElement("AdvanceFilter");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Select number of records to 10.");
                agent_1099SalesAgentHelper.SelectByText("ResultsPerPage", "10");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on Apply button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Verify number of records displayed.");
                agent_1099SalesAgentHelper.ShowResult(10);
                //agent_1099SalesAgentHelper.VerifyText("BottomResults", "Showing 1 - 10 of ");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on advance filter.");
                agent_1099SalesAgentHelper.ClickElement("AdvanceFilter");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Select number of records to 20.");
                agent_1099SalesAgentHelper.SelectByText("ResultsPerPage", "20");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on Apply button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Verify number of records displayed.");
                agent_1099SalesAgentHelper.ShowResult(20);
                //agent_1099SalesAgentHelper.VerifyText("BottomResults", "Showing 1 - 20 of ");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on advance filter.");
                agent_1099SalesAgentHelper.ClickElement("AdvanceFilter");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Select number of records to 50.");
                agent_1099SalesAgentHelper.SelectByText("ResultsPerPage", "50");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Verify number of records displayed.");
                agent_1099SalesAgentHelper.ShowResult(50);
                //agent_1099SalesAgentHelper.VerifyText("BottomResults", "Showing 1 - 50 of ");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on advance filter.");
                agent_1099SalesAgentHelper.ClickElement("AdvanceFilter");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Select number of records to 100.");
                agent_1099SalesAgentHelper.SelectByText("ResultsPerPage", "100");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Verify number of records displayed.");
                agent_1099SalesAgentHelper.ShowResult(100);
                //agent_1099SalesAgentHelper.VerifyText("BottomResults", "Showing 1 - 100 of ");
                //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Logout from the application.");
                VisitOffice("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SalesAgentsAdvanceFilterResultsPP");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Sales Agents Advance Filter ResultsPP");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Sales Agents Advance Filter ResultsPP", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Sales Agents Advance Filter ResultsPP");
                        TakeScreenshot("SalesAgentsAdvanceFilterResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SalesAgentsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("SalesAgentsAdvanceFilterResultsPP");
                        string id            = loginHelper.getIssueID("Sales Agents Advance Filter ResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SalesAgentsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Sales Agents Advance Filter ResultsPP"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Sales Agents Advance Filter ResultsPP");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SalesAgentsAdvanceFilterResultsPP");
                executionLog.WriteInExcel("Sales Agents Advance Filter ResultsPP", Status, JIRA, "Opportunities Management");
            }
        }
示例#2
0
        public void saleAgentWithUser()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var agent_1099SaleAagentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());
            var office_UserHelper          = new Office_UserHelper(GetWebDriver());

            // Variable random
            var    name   = "TESTCLIENT" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("SaleAgentWithUser", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("SaleAgentWithUser", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("SaleAgentWithUser", "Redirect To Sale Agent");
                VisitOffice("sales_agents/create");

                executionLog.Log("SaleAgentWithUser", "Wait for element to present.");
                agent_1099SaleAagentHelper.WaitForElementPresent("SelectSalutation", 5);

                executionLog.Log("SaleAgentWithUser", "Select Salutation");
                agent_1099SaleAagentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("SaleAgentWithUser", "Enter FirstNAME");
                agent_1099SaleAagentHelper.TypeText("FirstNAME", "Test Sale gent");

                executionLog.Log("SaleAgentWithUser", "Enter LastName");
                agent_1099SaleAagentHelper.TypeText("LastName", "Tester");

                executionLog.Log("SaleAgentWithUser", "Enter Date Of Birth");
                agent_1099SaleAagentHelper.TypeText("BirthDay", "1991-03-02");

                executionLog.Log("SaleAgentWithUser", "Select eAddressType");
                agent_1099SaleAagentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("SaleAgentWithUser", "Select eAddressLebel");
                agent_1099SaleAagentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("SaleAgentWithUser", "Enter eAddressType");
                var Email = "Sale" + RandomNumber(111, 9999) + "@yopmail.com";
                agent_1099SaleAagentHelper.TypeText("eAddress", Email);
                Console.WriteLine("Email is" + Email);

                executionLog.Log("SaleAgentWithUser", "Select SelectPhoneType");
                agent_1099SaleAagentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("SaleAgentWithUser", "Select Address Type   ");
                agent_1099SaleAagentHelper.Select("AddressType", "Office");

                executionLog.Log("SaleAgentWithUser", "Enter AddressLine1");
                agent_1099SaleAagentHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("SaleAgentWithUser", "Enter City");
                agent_1099SaleAagentHelper.TypeText("City", "Test City");

                executionLog.Log("SaleAgentWithUser", "Enter Zip code");
                agent_1099SaleAagentHelper.TypeText("PostalCode", "60601");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Check create a user account for agent field open or not");
                agent_1099SaleAagentHelper.ClickAndCheck("CollapseDetails");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Enter UserName");
                agent_1099SaleAagentHelper.TypeText("UserName", name);
                agent_1099SaleAagentHelper.WaitForWorkAround(1000);

                executionLog.Log("SaleAgentWithUser", "Click On Avatar");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSAvatarBtn");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Click on Save");
                agent_1099SaleAagentHelper.ClickElement("SaveSaleAgent");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Redirect To Admin");
                VisitOffice("admin");

                executionLog.Log("SaleAgentWithUser", "Redirect To User");
                VisitOffice("users");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Select user type as sale agent. ");
                office_UserHelper.Select("SearchUserType", "1099 Sales Agent");
                office_UserHelper.WaitForWorkAround(4000);

                executionLog.Log("SaleAgentWithUser", "Enter Email ");
                office_UserHelper.TypeText("EnterEmail", Email);
                office_UserHelper.WaitForWorkAround(30000);

                executionLog.Log("SaleAgentWithUser", "Verify Email ");
                //       office_UserHelper.VerifyPageText(Email);
                office_UserHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SaleAgentWithUser");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Sale Agent With User");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Sale Agent With User", "Bug", "Medium", "Sale agent page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Sale Agent With User");
                        TakeScreenshot("SaleAgentWithUser");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SaleAgentWithUser.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("SaleAgentWithUser");
                        string id            = loginHelper.getIssueID("Sale Agent With User");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SaleAgentWithUser.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Sale Agent With User"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Sale Agent With User");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SaleAgentWithUser");
                executionLog.WriteInExcel("Sale Agent With User", Status, JIRA, "Agents Portal");
            }
        }
        public void saleAgentEmailValidation()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var agent_1099SaleAagentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());

            // Variable random
            var    name   = "TESTCLIENT" + RandomNumber(1, 9999);
            String JIRA   = "";
            String Status = "Pass";


            try
            {
                executionLog.Log("SaleAgentEmailValidation", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("SaleAgentEmailValidation", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("SaleAgentEmailValidation", "Redirect To Create Agent page");
                VisitOffice("sales_agents/create");

                executionLog.Log("SaleAgentEmailValidation", "Wait for element to present");
                agent_1099SaleAagentHelper.WaitForElementPresent("SelectSalutation", 10);

                executionLog.Log("SaleAgentEmailValidation", "Select Salutation");
                agent_1099SaleAagentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("SaleAgentEmailValidation", "Enter FirstName");
                agent_1099SaleAagentHelper.TypeText("FirstNAME", "Test Sale gent");

                executionLog.Log("SaleAgentEmailValidation", "Enter LastName");
                agent_1099SaleAagentHelper.TypeText("LastName", "Tester");

                executionLog.Log("SaleAgentEmailValidation", "Enter Date Of Birth");
                agent_1099SaleAagentHelper.TypeText("BirthDay", "1991-03-02");

                executionLog.Log("SaleAgentEmailValidation", "Select eAddressType");
                agent_1099SaleAagentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("SaleAgentEmailValidation", "Select eAddressLebel");
                agent_1099SaleAagentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("SaleAgentEmailValidation", "Enter eAddress Type ");
                agent_1099SaleAagentHelper.TypeText("eAddress", "Testgmail.com");

                executionLog.Log("SaleAgentEmailValidation", "CLICK On Save");
                agent_1099SaleAagentHelper.ClickElement("SaveSaleAgent");

                agent_1099SaleAagentHelper.WaitForText("Please enter a valid email address.", 10);
                agent_1099SaleAagentHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SaleAgentEmailValidation");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Sale Agent Email Validation");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Sale Agent Email Validation", "Bug", "Medium", "Sale Agent page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Sale Agent Email Validation");
                        TakeScreenshot("SaleAgentEmailValidation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SaleAgentEmailValidation.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("SaleAgentEmailValidation");
                        string id            = loginHelper.getIssueID("Sale Agent Email Validation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SaleAgentEmailValidation.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Sale Agent Email Validation"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Sale Agent Email Validation");
                //     executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SaleAgentEmailValidation");
                executionLog.WriteInExcel("Sale Agent Email Validation", Status, JIRA, "Agents Portal");
            }
        }