Пример #1
0
        public static void VerifyFieldValues(string module, ModuleData data)
        {
            string moduleSelected = module;

            if (module.Contains("Flex"))
            {
                //Determine if Flex module is valid
                bool moduleValid = false;
                for (int i = 1; i < 10; i++)
                {
                    if (module == ("Flex" + i))
                    {
                        moduleValid |= true;
                        break;
                    }
                }
                if (!moduleValid)
                {
                    log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                    Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                    return;
                }
                //Set module name to Flex
                moduleSelected = "Flex";
            }

            switch (moduleSelected)
            {
            case "Incident":
            {
                IncidentPage.VerifyTicketFieldValues(data);
                break;
            }

            case "Problem":
            {
                ProblemPage.VerifyTicketFieldValues(data);
                break;
            }

            case "Change":
            {
                ChangePage.VerifyTicketFieldValues(data);
                break;
            }

            case "Flex":
            {
                FlexPage.VerifyTicketFieldValues(data);
                break;
            }

            default:
            {
                log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                break;
            }
            }
        }
Пример #2
0
        public static void AmIOnTicketPageSwitch(string module, string ticketNum)
        {
            switch (module)
            {
            case "Incident":
            {
                IncidentPage.AmIOnPage();
                IncidentPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Incident task":
            {
                IncidentTaskPage.AmIOnPage();
                IncidentTaskPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Problem":
            {
                ProblemPage.AmIOnPage();
                ProblemPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Change":
            {
                ChangePage.AmIOnPage();
                ChangePage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Change task":
            {
                ChangeTaskPage.AmIOnPage();
                ChangeTaskPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Flex1":
            {
                FlexPage.AmIOnPage(module);
                FlexPage.IsTicketNumberCorrect(module, ticketNum);
                break;
            }

            case "Flex2":
            {
                FlexPage.AmIOnPage(module);
                FlexPage.IsTicketNumberCorrect(module, ticketNum);
                break;
            }

            case "Announcement":
            {
                AnnouncementPage.AmIOnPage();
                break;
            }

            case "Knowledge Base":
            {
                KBPage.AmIOnPage(ticketNum);
                break;
            }

            case "Survey":
            {
                SurveyPage.AmIOnPage();
                break;
            }

            case "Report":
            {
                ReportsPage.AmIOnPage();
                break;
            }

            case "CI":
            {
                CIPage.AmIOnPage(ticketNum);
                break;
            }

            default:
            {
                log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                break;
            }
            }
        }