Ejemplo n.º 1
0
        public void allAgentDisplayePage()
        {
            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 agents_AllAgentsHelper = new Agents_AllAgentsHelper(GetWebDriver());


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

            try
            {
                executionLog.Log("AllAgentDisplayePage", "Login with valid username and password");
                Login(username[0], password[0]);

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

                executionLog.Log("AllAgentDisplayePage", "Click on Agent in Topmenu");
                agents_AllAgentsHelper.ClickElement("AgentTab");
                agents_AllAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("AllAgentDisplayePage", "Select SelectUserType");
                agents_AllAgentsHelper.Select("SelectUserType", "Employee");
                agents_AllAgentsHelper.WaitForWorkAround(2000);

                executionLog.Log("AllAgentDisplayePage", "Select SelectUserType");
                agents_AllAgentsHelper.Select("SelectUserType", "1099 Sales Agent");
                agents_AllAgentsHelper.WaitForWorkAround(2000);

                executionLog.Log("AllAgentDisplayePage", "Select SelectUserType");
                agents_AllAgentsHelper.Select("SelectUserType", "Partner Agent");
                agents_AllAgentsHelper.WaitForWorkAround(2000);

                executionLog.Log("AllAgentDisplayePage", "Select SelectUserType");
                agents_AllAgentsHelper.Select("SelectUserType", "Partner Association");
                agents_AllAgentsHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            XMLParse 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_AllAgentHelper = new Agents_AllAgentsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("FilterForAgent", "Visit agents pge.");
                VisitOffice("agents");
                agent_AllAgentHelper.WaitForWorkAround(1000);

                executionLog.Log("FilterForAgent", "Select Agent Type");
                agent_AllAgentHelper.Select("SelectUserType", "");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("FilterForAgent", "Select sattus as Active");
                agent_AllAgentHelper.Select("SelectStatus", "Active");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("FilterForAgent", "Select Role");
                agent_AllAgentHelper.Select("SelectRole", "");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("FilterForAgent", "Select Agent Department");
                agent_AllAgentHelper.Select("SelectDepartment", "");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("FilterForAgent", "Select Agent Team");
                agent_AllAgentHelper.Select("SelectTeam", "");
                agent_AllAgentHelper.WaitForWorkAround(2000);
            }


            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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