Example #1
0
        private static bool IsFormTicketNumberVisible(string flexType, string ticketNum)
        {
            string pfix;

            if (flexType == "Flex1")
            {
                pfix = "FM1";
            }
            else
            {
                pfix = "FM2";
            }
            bool isTicketNumberVisible = GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains(ticketNum);

            isTicketNumberVisible &= GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains(pfix);

            if (!(isTicketNumberVisible))
            {
                log.Info(flexType + " form ticket details ticket number was not found.");
            }
            else
            {
                log.Info(flexType + " form ticket details ticket number was found.");
            }
            return(isTicketNumberVisible);
        }
Example #2
0
        private static bool IsPageTitleVisible(string flexNumber)
        {
            string flexType = flexNumber;

            if (flexType == "Flex1")
            {
                if (!(GeneralPage.IsElementVisible(ID.GenerateFlexPageTitleXPath(flexType))))
                {
                    log.Error(flexType + " page title was not found.");
                }
                else
                {
                    log.Info(flexType + " page title was found.");
                }

                return(GeneralPage.IsElementVisible(ID.GenerateFlexPageTitleXPath(flexType)));
            }
            else
            {
                if (!(GeneralPage.IsElementVisible(ID.GenerateFlexPageTitleXPath(flexType))))
                {
                    log.Error(flexType + " page title was not found.");
                }
                else
                {
                    log.Info(flexType + " page title was found.");
                }

                return(GeneralPage.IsElementVisible(ID.GenerateFlexPageTitleXPath(flexType)));
            }
        }
Example #3
0
        public static bool AmILoggedIn()
        {
            bool loginTextBoxesVisible = true;

            loginTextBoxesVisible &= GeneralPage.IsElementVisible(ID.userInputBox);
            loginTextBoxesVisible &= GeneralPage.IsElementVisible(ID.passwordInputBox);

            return(!loginTextBoxesVisible);
        }
Example #4
0
        private static bool IsViewVisible(string page)
        {
            bool   viewVisible = true;
            string view;

            switch (page)
            {
            case "Incident Template Manager":
            {
                view = ID.incidentView;
                break;
            }

            case "Problem Template Manager":
            {
                view = ID.problemView;
                break;
            }

            case "Change Template Manager":
            {
                view = ID.changeView;
                break;
            }

            case "Flex1 Template Manager":
            {
                view = ID.flex1View;
                break;
            }

            case "Flex2 Template Manager":
            {
                view = ID.flex2View;
                break;
            }

            default:
            {
                view = "Incorrect module: TemplateManagerPage.cs";
                break;
            }
            }

            viewVisible = GeneralPage.IsElementVisible(view);
            if (!(viewVisible))
            {
                log.Error(page + " View was not found.");
            }
            else
            {
                log.Info(page + " View was found.");
            }

            return(viewVisible);
        }
Example #5
0
        public static void NavigateToTicketURL(string moduleURL, int ticketNum)
        {
            string old = GeneralPage.GetCurrentWindow();

            NavigateToURL("http://" + Hooks1.webSrvr + "/CGWeb/MainUI/MainFrame.aspx" + moduleURL + "&ID=" + ticketNum);
            //NavigateToURL("http://" + Hooks1.webSrvr + "/" + Hooks1.webVirtDir + moduleURL + "&ID=" + ticketNum);

            //Switch to new window passing the old window as parameter
            GeneralPage.SwitchToNewWindow(old);
        }
Example #6
0
 public static void AmIOnLoggedOutPage()
 {
     if (!GeneralPage.IsElementVisible(ID.loggedOutMessage))
     {
         log.Error("Logged out page was not found.");
     }
     else
     {
         log.Info("Logged out page was found.");
     }
     Assert.IsTrue(GeneralPage.IsElementVisible(ID.loggedOutMessage));
 }
Example #7
0
        public static void NavigateToURL(string flexNumber)
        {
            string flexType = flexNumber;

            if (flexType == "Flex1")
            {
                GeneralPage.NavigateToURL(moduleURLs.main);
            }
            else
            {
                GeneralPage.NavigateToURL(moduleURLs.main);
            }
        }
Example #8
0
        private static bool IsPageTitleVisible()
        {
            if (!(GeneralPage.IsElementVisible(ID.serviceCatalogPageTitle)))
            {
                log.Error("Service Catalog page title was not found.");
            }
            else
            {
                log.Info("Service Catalog page title was found.");
            }

            return(GeneralPage.IsElementVisible(ID.serviceCatalogPageTitle));
        }
Example #9
0
        private static bool IsPageTitleVisible()
        {
            if (!(GeneralPage.IsElementVisible(ID.AnnouncementPortalPageTitle)))
            {
                log.Info("Announcement Portal page title was not found.");
            }
            else
            {
                log.Info("Announcement Portal page title was found.");
            }

            return(GeneralPage.IsElementVisible(ID.AnnouncementPortalPageTitle));
        }
Example #10
0
        private static bool IsPageTitleVisible()
        {
            if (!(GeneralPage.IsElementVisible(ID.changePageTitle)))
            {
                log.Info("Change page title was not found.");
            }
            else
            {
                log.Info("Change page title was found.");
            }

            return(GeneralPage.IsElementVisible(ID.changePageTitle));
        }
Example #11
0
        private static bool IsViewLinkVisible()
        {
            if (!(GeneralPage.IsElementVisible(ID.flex1DefaultReportsView)))
            {
                log.Info("Flex1 Default Reports view was not found.");
            }
            else
            {
                log.Info("Flex1 Default Reports view was found.");
            }

            return(GeneralPage.IsElementVisible(ID.flex1DefaultReportsView));
        }
Example #12
0
        private static bool IsViewLinkVisible()
        {
            if (!(GeneralPage.IsElementVisible(ID.allTicketsView)))
            {
                log.Info("All Tickets view was not found.");
            }
            else
            {
                log.Info("All Tickets view was found.");
            }

            return(GeneralPage.IsElementVisible(ID.allTicketsView));
        }
Example #13
0
        private static bool IsGeneratedMessageVisible()
        {
            GeneralPage.SwitchToFrame(ID.reportFrame);
            if (!(GeneralPage.IsElementVisible(ID.generatedMessage)))
            {
                log.Info("Reports generated message was not found.");
            }
            else
            {
                log.Info("Reports generated message was found.");
            }

            return(GeneralPage.IsElementVisible(ID.generatedMessage));
        }
Example #14
0
        private static bool IsPageTitleVisible()
        {
            bool userCenterPageTitleFound = GeneralPage.ExtractTextFromElement(ID.userCenterTitle).Contains("User Center");

            if (!(userCenterPageTitleFound))
            {
                log.Info("User Center Page title was not found.");
            }
            else
            {
                log.Info("User Center Page title was found.");
            }
            return(userCenterPageTitleFound);
        }
Example #15
0
        private static bool IsSurveyTitleVisible()
        {
            bool isTitleVisible = GeneralPage.IsElementVisible(ID.surveyPageTitle);

            if (!(isTitleVisible))
            {
                log.Info("Survey page title was not found.");
            }
            else
            {
                log.Info("Survey page title was found.");
            }
            return(isTitleVisible);
        }
Example #16
0
        private static bool IsWindowTitleTicketNumberVisible(string ticketNum)
        {
            bool isTicketNumberVisible = GeneralPage.GetWindowTitle().Contains(ticketNum);

            if (!(isTicketNumberVisible))
            {
                log.Info("Incident form window title ticket number was not found.");
            }
            else
            {
                log.Info("Incident form window title ticket number was found.");
            }
            return(isTicketNumberVisible);
        }
Example #17
0
        private static bool IsRequestTypeVisible()
        {
            bool requestTypeFound = GeneralPage.IsElementVisible(ID.requestType);

            if (!(requestTypeFound))
            {
                log.Info("User Center Request Type was not found.");
            }
            else
            {
                log.Info("User Center Request Type was found.");
            }
            return(requestTypeFound);
        }
Example #18
0
        private static bool IsProfileTabVisible()
        {
            bool profileTabFound = GeneralPage.IsElementVisible(ID.profileTab);

            if (!(profileTabFound))
            {
                log.Info("User Center Profile tab was not found.");
            }
            else
            {
                log.Info("User Center Profile tab was found.");
            }
            return(profileTabFound);
        }
Example #19
0
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool incidentFormTitleFound = GeneralPage.GetWindowTitle().Contains("Incident");

            if (!(incidentFormTitleFound))
            {
                log.Info("Incident form window title was not found.");
            }
            else
            {
                log.Info("Incident form window title was found.");
            }
            return(incidentFormTitleFound);
        }
Example #20
0
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool problemFormTitleFound = GeneralPage.GetWindowTitle().Contains("Problem");

            if (!(problemFormTitleFound))
            {
                log.Info("Problem form window title was not found.");
            }
            else
            {
                log.Info("Problem form window title was found.");
            }
            return(problemFormTitleFound);
        }
Example #21
0
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool changeFormTitleFound = GeneralPage.GetWindowTitle().Contains("RFC");

            if (!(changeFormTitleFound))
            {
                log.Info("Change form window title was not found.");
            }
            else
            {
                log.Info("Change form window title was found.");
            }
            return(changeFormTitleFound);
        }
Example #22
0
        private static bool IsViewDropDownOptionVisible()
        {
            GeneralPage.SwitchToFrame(ID.mainGridFrame);
            GeneralPage.ClickOnObject(ID.viewChooser);
            if (!(GeneralPage.IsElementVisible(ID.allServicesViewDropdownOption)))
            {
                log.Error("All Services view dropdown option was not found.");
            }
            else
            {
                log.Info("All Services view dropdown option was found.");
            }

            return(GeneralPage.IsElementVisible(ID.allServicesViewDropdownOption));
        }
Example #23
0
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool userCenterWindowTitleFound = GeneralPage.GetWindowTitle().Contains("User Center");

            if (!(userCenterWindowTitleFound))
            {
                log.Info("User Center window title was not found.");
            }
            else
            {
                log.Info("User Center window title was found.");
            }
            return(userCenterWindowTitleFound);
        }
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool announcementManagerTitleFound = GeneralPage.GetWindowTitle().Contains("Announcement");

            if (!(announcementManagerTitleFound))
            {
                log.Info("Announcement Manager window title was not found.");
            }
            else
            {
                log.Info("Announcement Manager window title was found.");
            }
            return(announcementManagerTitleFound);
        }
Example #25
0
        private static bool IsWindowTitleVisible()
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool templateManagerTitleFound = GeneralPage.GetWindowTitle().Contains("Templates");

            if (!(templateManagerTitleFound))
            {
                log.Error("Template Manager window title was not found.");
            }
            else
            {
                log.Info("Template Manager window title was found.");
            }
            return(templateManagerTitleFound);
        }
Example #26
0
        private static bool IsWindowTitleVisible(string flexType)
        {
            log.Info("Window Title is: " + GeneralPage.GetWindowTitle());
            bool flexFormTitleFound = GeneralPage.GetWindowTitle().Contains(flexType);

            if (!(flexFormTitleFound))
            {
                log.Info(flexType + " form window title was not found.");
            }
            else
            {
                log.Info(flexType + " form window title was found.");
            }
            return(flexFormTitleFound);
        }
Example #27
0
        //public static void FillInIncidentFields(string module, ModuleData data)
        //{
        //    log.Info("Selecting the requester: " + data.Requester);
        //    GeneralPage.ClickOnObject(ID.requester);
        //    GeneralPage.ClickOnObject(ID.GenerateRequesterXPath(data.Requester));

        //    log.Info("Sending summary text: " + data.Summary);
        //    GeneralPage.InputTextInTextbox(data.Summary, ID.summary);

        //    log.Info("Selecting Incident type: " + data.Type);
        //    GeneralPage.ClickOnObject(ID.incidentTypeArrow);
        //    SelectIncidentType(data.Type);

        //    log.Info("Selecting owner: " + data.Owner);
        //    GeneralPage.ClickOnObject(ID.owner);
        //    GeneralPage.ClickOnObject(ID.GenerateOwnerXPath(data.Owner));

        //    log.Info("Selecting assigne: " + data.Assignee);
        //    GeneralPage.ClickOnObject(ID.assignee);
        //    GeneralPage.ClickOnObject(ID.GenerateAssigneeXPath(data.Assignee));

        //    log.Info("Selecting Impact: " + data.Impact);
        //    GeneralPage.SelectOptionFromDropdown(ID.impactDropdown, data.Impact);

        //    log.Info("Selecting Urgency: " + data.Urgency);
        //    GeneralPage.SelectOptionFromDropdown(ID.urgencyDropdown, data.Urgency);

        //    log.Info("Selecting Priority: " + data.Priority);
        //    GeneralPage.SelectOptionFromDropdown(ID.priorityDropdown, data.Priority);

        //    log.Info("Selecting Today as Due Date");
        //    GeneralPage.ClickOnObject(ID.dueDateButton);
        //    GeneralPage.ClickOnObject(ID.calendarToday);

        //    if (data is IncidentData)
        //    {
        //        log.Info(((IncidentData)data).Origin);
        //        log.Info(((IncidentData)data).ImpactedBusinessServices);
        //    }
        //}

        public static void VerifyTicketFieldValues(ModuleData data)
        {
            log.Info("Verifying if values are correct...");
            bool valuesMatch = true;
            var  dictionary  = new Dictionary <string, bool>();

            dictionary.Add("Requester", (data.Requester == GeneralPage.ExtractValueFromElement(ID.requesterValue)));
            dictionary.Add("Summary", (data.Summary == GeneralPage.ExtractValueFromElement(ID.Summary)));
            //Verify if type is correct
            string[] typeHierarchyListExpected = (data.Type).Split(':');
            string[] typeHierarchyListActual   = (GeneralPage.ExtractValueFromElement(ID.TicketTypeValue)).Split(':');
            bool     numTypeLevelsMatch        = (typeHierarchyListActual.Count() == typeHierarchyListExpected.Count());

            valuesMatch &= numTypeLevelsMatch;
            bool typeLevelMatch = true;

            if (numTypeLevelsMatch)
            {
                for (int i = 0; i < typeHierarchyListExpected.Count(); i++)
                {
                    typeLevelMatch &= typeHierarchyListActual[i].Contains(typeHierarchyListExpected[i]);
                }
            }
            else
            {
                log.Info("Type levels do not match");
            }

            dictionary.Add("Type", typeLevelMatch);
            dictionary.Add("Owner", (data.Owner == GeneralPage.ExtractValueFromElement(ID.ownerValue)));
            dictionary.Add("Assignee", (data.Assignee == GeneralPage.ExtractValueFromElement(ID.assigneeValue)));
            dictionary.Add("Impact", (data.Impact == GeneralPage.ExtractTextFromElement(ID.impactValue)));
            dictionary.Add("Urgency", (data.Urgency == GeneralPage.ExtractTextFromElement(ID.urgencyValue)));
            dictionary.Add("Priority", (data.Priority == GeneralPage.ExtractTextFromElement(ID.priorityValue)));

            foreach (KeyValuePair <string, bool> entry in dictionary)
            {
                log.Info(entry.Key + ": " + entry.Value);
                valuesMatch &= entry.Value;
            }

            if (!valuesMatch)
            {
                log.Error("One or more field values do not match. Check the logs above to see which field is incorrect");
            }

            Assert.IsTrue(valuesMatch);
        }
Example #28
0
        private static bool IsFormTicketNumberVisible(string ticketNum)
        {
            bool isTicketNumberVisible = GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains(ticketNum);

            isTicketNumberVisible &= GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains("IR");

            if (!(isTicketNumberVisible))
            {
                log.Info("Incident form ticket details ticket number was not found.");
            }
            else
            {
                log.Info("Incident form ticket details ticket number was found.");
            }
            return(isTicketNumberVisible);
        }
Example #29
0
        public static void AmIOnPage()
        {
            bool loginTextBoxesVisible = true;

            loginTextBoxesVisible &= GeneralPage.IsElementVisible(ID.userInputBox);
            loginTextBoxesVisible &= GeneralPage.IsElementVisible(ID.passwordInputBox);

            if (loginTextBoxesVisible)
            {
                log.Info("Log in form textboxes were found.");
            }
            else
            {
                log.Error("One or more required textboxes were not found.");
                Assert.Fail("One or more required textboxes were not found.");
            }
        }
Example #30
0
        private static bool VerifyHierarchyField(ServiceRequestData data, string fieldID)
        {
            string location      = "";
            string locationXPath = "";

            if (fieldID == "CurrentLocation")
            {
                location      = data.CurrentLocation;
                locationXPath = ID.currentLocationValue;
            }
            else if (fieldID == "NewLocation")
            {
                location      = data.NewLocation;
                locationXPath = ID.newLocationValue;
            }
            else
            {
                log.Info("From the VerifyHierarchyField method of the ServiceRequestPage.cs file. Incorrect parameter passed: " +
                         fieldID);
                Assert.Fail("From the VerifyHierarchyField method of the ServiceRequestPage.cs file. Incorrect parameter passed: " +
                            fieldID);
                return(false);
            }

            //Verify if  is correct
            string[] typeHierarchyListExpected = location.Split(':');
            string[] typeHierarchyListActual   = (GeneralPage.ExtractValueFromElement(locationXPath)).Split(':');
            bool     numTypeLevelsMatch        = (typeHierarchyListActual.Count() == typeHierarchyListExpected.Count());

            bool typeLevelMatch = true;

            if (numTypeLevelsMatch)
            {
                for (int i = 0; i < typeHierarchyListExpected.Count(); i++)
                {
                    typeLevelMatch &= typeHierarchyListActual[i].Contains(typeHierarchyListExpected[i]);
                }
            }
            else
            {
                typeLevelMatch &= numTypeLevelsMatch;
                log.Error("Type levels do not match. Check the Service request feature file for errors");
            }

            return(typeLevelMatch);
        }