Beispiel #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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        private static bool IsPageTicketNumberVisible(string ticketNum)
        {
            GeneralPage.SwitchToFrame(ID.kbArticleFrame);
            bool isTicketNumberVisible = GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains(ticketNum);

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

            if (!(isTicketNumberVisible))
            {
                log.Info("KB ticket details ticket number was not found.");
            }
            else
            {
                log.Info("KB ticket details ticket number was found.");
            }
            return(isTicketNumberVisible);
        }
Beispiel #6
0
        private static bool AreCIFormElementsVisible(string ciNum)
        {
            bool areElementsVisible = GeneralPage.IsElementVisible(ID.ciField);

            areElementsVisible &= GeneralPage.IsElementVisible(ID.configurationTab);
            areElementsVisible &= GeneralPage.IsElementVisible(ID.relationshipsTab);
            areElementsVisible &= GeneralPage.ExtractTextFromElement(ID.ticketInfo).Contains(ciNum);

            if (!(areElementsVisible))
            {
                log.Error("One or more CI form elements were not found.");
            }
            else
            {
                log.Info("All CI form elements were found.");
            }

            return(areElementsVisible);
        }
Beispiel #7
0
        public static void VerifyTicketFieldValues(string ticketType, ServiceRequestData data)
        {
            log.Info("Verifying if " + ticketType + " 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)));

            //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);
            if (ticketType == "Move Request")
            {
                dictionary.Add("Employee Name", (data.EmployeeName == GeneralPage.ExtractValueFromElement(ID.employeeName)));
                dictionary.Add("Employee Type", (((ServiceRequestData)data).EmployeeType == GeneralPage.ExtractValueFromElement(ID.employeeType)));
                dictionary.Add("Position", (((ServiceRequestData)data).Position == GeneralPage.ExtractValueFromElement(ID.position)));
                dictionary.Add("Current Cube or Office", (((ServiceRequestData)data).CurrentCubeOrOffice == GeneralPage.ExtractValueFromElement(ID.currentCubeOffice)));
                dictionary.Add("New Cube or Office", (((ServiceRequestData)data).NewCubeOrOffice == GeneralPage.ExtractValueFromElement(ID.newCubeOffice)));
                dictionary.Add("Current Phone Ext", (((ServiceRequestData)data).CurrentPhoneExt == GeneralPage.ExtractValueFromElement(ID.currentPhoneExt)));
                dictionary.Add("New Phone Ext", (((ServiceRequestData)data).NewPhoneExt == GeneralPage.ExtractValueFromElement(ID.newPhoneExt)));
                dictionary.Add("Current Location", VerifyHierarchyField(data, "CurrentLocation"));
                dictionary.Add("New Location", VerifyHierarchyField(data, "NewLocation"));
            }
            else
            {
                switch (ticketType)
                {
                case "Access Request":
                {
                    dictionary.Add("System", ((ServiceRequestData)data).System == GeneralPage.ExtractTextFromElement(ID.systemValue));
                    dictionary.Add("Access Level", ((ServiceRequestData)data).AccessLevel == GeneralPage.ExtractTextFromElement(ID.accessLevelValue));
                    dictionary.Add("Access Location", ((ServiceRequestData)data).AccessLocation == GeneralPage.ExtractTextFromElement(ID.accessLocationValue));
                    break;
                }

                case "General Request":
                {
                    break;
                }

                case "Hardware Request":
                {
                    dictionary.Add("Hardware Type", ((ServiceRequestData)data).HardwareType == GeneralPage.ExtractTextFromElement(ID.hardwareTypeValue));
                    dictionary.Add("Operating System", ((ServiceRequestData)data).OperatingSystem == GeneralPage.ExtractTextFromElement(ID.operatingSystemValue));
                    break;
                }

                case "Software Request":
                {
                    dictionary.Add("Requested Software", ((ServiceRequestData)data).RequestedSoftware == GeneralPage.ExtractTextFromElement(ID.requestedSoftwareValue));
                    dictionary.Add("Operating System", ((ServiceRequestData)data).OperatingSystem == GeneralPage.ExtractTextFromElement(ID.operatingSystemValue));
                    break;
                }

                case "Training Request":
                {
                    dictionary.Add("Course Name", data.CourseName == GeneralPage.ExtractValueFromElement(ID.coursenameTextbox));
                    dictionary.Add("Program Type", data.ProgramType == GeneralPage.ExtractTextFromElement(ID.programTypeValue));
                    dictionary.Add("Training Level", data.TrainingLevel == GeneralPage.ExtractTextFromElement(ID.trainingLevelValue));
                    dictionary.Add("Course Cost", data.CourseCost == GeneralPage.ExtractValueFromElement(ID.courseCostTextbox));
                    break;
                }

                default:
                {
                    log.Info("Unrecognized Service request type. Check the feature file for errors.");
                    Assert.Fail("Unrecognized Service request type. Check the feature file for errors.");
                    break;
                }
                }
                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);
        }