protected void NavigateToDecisionPage(DecisionJourney decisionJourneyPage)
 {
     decisionJourneyPage.Validate();
     if (ShouldSelectYes(decisionJourneyPage))
     {
         decisionJourneyPage.SelectYes();
     }
     else
     {
         decisionJourneyPage.SelectNo();
     }
     decisionJourneyPage.Continue();
 }
Beispiel #2
0
        public void InitiateJourneySteps(string page)
        {
            switch (page)
            {
            case RepresentativePageNames.AboutYou:
                _aboutYou.Validate();
                _currentPage = _aboutYou;
                break;

            case RepresentativePageNames.AboutYourClient:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                _currentPage = _aboutYourClient;
                break;

            case RepresentativePageNames.ClientAttendance:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                _currentPage = _clientAttendance;
                break;

            case RepresentativePageNames.HearingSuitability:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                NavigateToDecisionPage(_clientAttendance);
                _currentPage = _hearingSuitability;
                break;

            case RepresentativePageNames.AccessToRoom:
                NavigateToDecisionPage(_aboutYou);
                _currentPage = _accessToRoom;
                break;

            case RepresentativePageNames.YourComputer:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                NavigateToDecisionPage(_clientAttendance);
                NavigateToDecisionPage(_hearingSuitability);
                _currentPage = _yourComputer;
                break;

            case RepresentativePageNames.AboutYourComputer:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                NavigateToDecisionPage(_clientAttendance);
                NavigateToDecisionPage(_hearingSuitability);
                NavigateToDecisionPage(_yourComputer);
                _currentPage = _aboutYourComputer;
                break;

            case SelfTestPageNames.CheckYourComputer:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                NavigateToDecisionPage(_clientAttendance);
                NavigateToDecisionPage(_hearingSuitability);
                NavigateToDecisionPage(_yourComputer);
                NavigateToDecisionPage(_aboutYourComputer);
                _questionnaireCompleted.Continue();
                _currentPage = _checkYourComputer;
                break;

            case SelfTestPageNames.SwitchOnCameraAndMicrophone:
                NavigateToDecisionPage(_aboutYou);
                NavigateToDecisionPage(_accessToRoom);
                NavigateToDecisionPage(_aboutYourClient);
                NavigateToDecisionPage(_clientAttendance);
                NavigateToDecisionPage(_hearingSuitability);
                NavigateToDecisionPage(_yourComputer);
                NavigateToDecisionPage(_aboutYourComputer);
                _questionnaireCompleted.Continue();
                NavigateToDecisionPage(_checkYourComputer);
                _currentPage = _switchOnCameraAndMicrophone;
                break;
            }
            _scenarioContext.Set <DecisionJourney>(_currentPage, "CurrentPage");
        }