示例#1
0
        private bool HandleNavigationRequest(NavigationEntry currentNavigation)
        {
            bool hasFailures = false;

            IEXGateway._IEXResult res;
            List <KeyValuePair <string, MilestoneError> > msError;

            Logger.StartNavigation(currentNavigation.GetFullPath());
            string nextState = currentNavigation.GetNextState();

            while (nextState != null)
            {
                State dest = expectedMilestones.GetStateByName(nextState);
                if (dest == null)
                {
                    LogWriter("Error: State " + nextState + " is Not Defined in ExpectedMilestonesPerState.txt");
                    break;
                }

                if (nextState.Equals("[PIN]"))
                {
                    nextState = currentNavigation.GetNextState();
                    CL.EA.EnterDeafultPIN(nextState.Replace("amp;", ""));
                }

                Logger.StartDestination(dest);
                MilestonesChecker.Start(CL, nextState);
                res     = CL.IEX.MilestonesEPG.Navigate(nextState.Replace("amp;", "")); //To handle "PIN & PARENTAL CONTROL";
                msError = MilestonesChecker.Finish(dest, CL, res, nextState);
                if (msError.Count > 0)
                {
                    hasFailures = true;
                    Logger.DestinationFail(msError);
                    if (!res.CommandSucceeded)
                    {
                        LogWriter("Navigation Failed : " + res.FailureReason);
                        CL.IEX.GetSnapshot("Navigation Failed");
                        Logger.FailNavigation(res.FailureReason);
                        break;
                    }
                    LogWriter("Navigation Succeeded But Validation Failed, Check outPut.txt For More Details");
                }
                nextState = currentNavigation.GetNextState();
            }
            Logger.FinishNavigation(hasFailures);

            if (hasFailures)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        public int Run()
        {
            bool   hasFailures    = false;
            string action         = actionsList.GetNextAction();
            int    iFailuresCount = 0;

            while (action != null)
            {
                if (action == "Navigation")
                {
                    NavigationEntry currentNavigation = actionsList.GetNextNavigation();
                    hasFailures = HandleNavigationRequest(currentNavigation);
                    int iActionCount = 0;
                    while (hasFailures && iActionCount < 2)
                    {
                        actionsList.CurrentAction--;
                        action = actionsList.GetNextAction();
                        actionsList.CurrentNav--;
                        currentNavigation = actionsList.GetNextNavigation();
                        currentNavigation.CurrentIndex = 0;
                        hasFailures = HandleNavigationRequest(currentNavigation);
                        iActionCount++;
                        if (iActionCount == 2 && hasFailures)
                        {
                            iFailuresCount++;
                            LogWriter("**************Navigation Failed After " + (iActionCount + 1) + " Try**************");
                        }
                    }
                }
                else if (action == "SelectMenuItem")
                {
                    hasFailures = HandleSelectItemRequest();
                }
                action = actionsList.GetNextAction();
            }

            Logger.WriteSummary();
            return(iFailuresCount);
        }