예제 #1
0
        public void labelDoubleClickToAddTopicTicket()
        {
            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 officeTickets_AllTicketsHelper = new OfficeTickets_AllTicketsHelper(GetWebDriver());

            // Random Variables
            String JIRA   = "";
            String Status = "Pass";
            var    Name   = "Ticket" + RandomNumber(1, 500);


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

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

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Redirect at opportunities task");
                VisitOffice("tickets");
                officeTickets_AllTicketsHelper.WaitForWorkAround(5000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "create a ticket");
                officeTickets_AllTicketsHelper.ClickElement("CreateBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(2000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Enter the ticket name");
                officeTickets_AllTicketsHelper.TypeText("Subject", Name);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Select a Client");
                officeTickets_AllTicketsHelper.ClickElement("SelectClientBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(4000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Select the Company");
                officeTickets_AllTicketsHelper.ClickElement("FirstCompany");
                officeTickets_AllTicketsHelper.WaitForWorkAround(4000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Click on 'Save' button");
                officeTickets_AllTicketsHelper.ClickElement("SaveBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(7000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Verify label for ticket displayed.");
                officeTickets_AllTicketsHelper.VerifyText("TOpicVerify", "Double click to add");

                VisitOffice("tickets");
                officeTickets_AllTicketsHelper.WaitForWorkAround(4000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Search the ticket");
                officeTickets_AllTicketsHelper.TypeText("SearchTicket", Name);
                officeTickets_AllTicketsHelper.WaitForWorkAround(4000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Click on check box");
                officeTickets_AllTicketsHelper.ClickElement("TicketInputIcon");
                officeTickets_AllTicketsHelper.WaitForWorkAround(2000);

                executionLog.Log("LabelDoubleClickToAddTopicTicket", "Click on delete button");
                officeTickets_AllTicketsHelper.ClickElement("DeleteIcon");
                officeTickets_AllTicketsHelper.WaitForWorkAround(2000);
                officeTickets_AllTicketsHelper.AcceptAlert();
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LabelDoubleClickToAddTopicTicket");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Label Double Click To Add Topic");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Label Double Click To Add Topic", "Bug", "Medium", "Tickets page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Label Double Click To Add Topic");
                        TakeScreenshot("LabelDoubleClickToAddTopicTicket");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LabelDoubleClickToAddTopicTicket.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LabelDoubleClickToAddTopicTicket");
                        string id            = loginHelper.getIssueID("Label Double Click To Add Topic");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LabelDoubleClickToAddTopicTicket.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Label Double Click To Add Topic"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Label Double Click To Add Topic");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LabelDoubleClickToAddTopicTicket");
                executionLog.WriteInExcel("Label Double Click To Add Topic", Status, JIRA, "Office Tickets");
            }
        }
예제 #2
0
        public void ticketPopupIssue()
        {
            string[] username = null;
            string[] password = null;
            String   JIRA     = "";
            String   Status   = "Pass";

            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 officeTickets_AllTicketsHelper = new OfficeTickets_AllTicketsHelper(GetWebDriver());

            var Name = "TicketQA" + RandomNumber(10, 100);

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

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

                executionLog.Log("TicketPopupIssue", "Go to Ticket page");
                VisitOffice("tickets");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);

                executionLog.Log("TicketPopupIssue", "Verify title");
                VerifyTitle("Tickets");

                executionLog.Log("TicketPopupIssue", "Create the new ticket");
                officeTickets_AllTicketsHelper.ClickElement("CreateBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);

                executionLog.Log("TicketPopupIssue", "Enter the name");
                officeTickets_AllTicketsHelper.TypeText("Subject", Name);

                executionLog.Log("TicketPopupIssue", "select the status ");
                officeTickets_AllTicketsHelper.SelectByText("TicketStatus", "New");

                executionLog.Log("TicketPopupIssue", "select the client");
                officeTickets_AllTicketsHelper.ClickElement("SelectClientBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);
                officeTickets_AllTicketsHelper.ClickElement("FirstCompany");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);

                executionLog.Log("TicketPopupIssue", "Click on Save button");
                officeTickets_AllTicketsHelper.ClickElement("SaveBtn");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);

                VisitOffice("tickets");
                officeTickets_AllTicketsHelper.WaitForWorkAround(3000);

                executionLog.Log("TicketPopupIssue", "search the ticket");
                officeTickets_AllTicketsHelper.TypeText("SearchTicket", Name);
                officeTickets_AllTicketsHelper.WaitForWorkAround(2000);

                executionLog.Log("TicketPopupIssue", "Select first ticket");
                officeTickets_AllTicketsHelper.ClickElement("Ticket1");

                executionLog.Log("TicketPopupIssue", "Click on Delete button");
                officeTickets_AllTicketsHelper.ClickElement("DelTick");

                executionLog.Log("TicketPopupIssue", "Accept alert");
                officeTickets_AllTicketsHelper.AcceptAlert();

                executionLog.Log("TicketPopupIssue", "Verify title");
                VerifyTitle("Tickets");

                executionLog.Log("TicketPopupIssue", "Verify No Popup displayed");
                Console.WriteLine(officeTickets_AllTicketsHelper.VerifyAlertNotPresent());
                Assert.IsTrue(officeTickets_AllTicketsHelper.VerifyAlertNotPresent());
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("TicketPopupIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Ticket Popup Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Ticket Popup Issue", "Bug", "Medium", "Ticket page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Ticket Popup Issue");
                        TakeScreenshot("TicketPopupIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\TicketPopupIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("TicketPopupIssue");
                        string id            = loginHelper.getIssueID("Ticket Popup Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\TicketPopupIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Ticket Popup Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Ticket Popup Issue");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("TicketPopupIssue");
                executionLog.WriteInExcel("Ticket Popup Issue", Status, JIRA, "Ticketing System");
            }
        }
예제 #3
0
        public void deleteTicket()
        {
            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    officeTickets_AllTicketsHelper = new OfficeTickets_AllTicketsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("DeleteTicket", "Go to Ticket page");
                VisitOffice("tickets");

                executionLog.Log("DeleteTicket", "Verify title");
                VerifyTitle("Tickets");

                executionLog.Log("DeleteTicket", "Select first ticket");
                officeTickets_AllTicketsHelper.ClickElement("FirstCheckBox");

                executionLog.Log("DeleteTicket", "Click on Delete button");
                officeTickets_AllTicketsHelper.ClickElement("DelTick");

                executionLog.Log("DeleteTicket", "Accept alert");
                officeTickets_AllTicketsHelper.AcceptAlert();

                executionLog.Log("DeleteTicket", "Verify success message");
                officeTickets_AllTicketsHelper.WaitForText("0 Records deleted successfully and 1 don't have permissions", 30);

                executionLog.Log("DeleteTicket", "Verify No error message displayed");
                officeTickets_AllTicketsHelper.VerifyTextNotPresent("An Internal Error Occurred");

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

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