public LearnerRequestObsObject SearchAndSelectObserverAndTemplateOnRequestObservationForm(string observerName, string templateName)
        {
            RequestObsFormObsNameTxt.SendKeys(observerName);
            ClickAndWait(RequestObsFormSearchBtn);

            ElemSet.RdoBtn_ClickByText(Browser, observerName);
            ElemSet.RdoBtn_ClickByText(Browser, templateName);

            return(new LearnerRequestObsObject(observerName, templateName));
        }
Exemple #2
0
        public LearnerRequestObsObject SearchAndSelectObserverAndTemplateOnRequestObservationForm(string observerName, string templateName)
        {
            RequestObsFormObsNameTxt.SendKeys(observerName);
            // Mike Johnston 1/25/18: Test failed this morning. On screenshot, the text was entered just fine, but it looks like the search button was
            // not clicked, because ALL observers showed in the list. Maybe it clicks Search too quickly after text entry. I am going to add a small
            // sleep here. Monitor going forward. Also see notes inside ClickAndWait(RequestObsFormSearchBtn);
            Thread.Sleep(0200);
            ClickAndWait(RequestObsFormSearchBtn);

            ElemSet.RdoBtn_ClickByText(Browser, observerName);
            ElemSet.RdoBtn_ClickByText(Browser, templateName);

            return(new LearnerRequestObsObject(observerName, templateName));
        }
        /// <summary>
        /// Opens the Add Observation window if it is not already open, then chooses a user-specified learner, clicks the Next button,
        /// chooses the EPA radio button, chooses a user-specified stage, epa and observation tool, then completes the observation
        /// </summary>
        /// <param name="learnerFullName">The first and last name of the learner</param>
        /// <param name="observationType">Not implemented yet, just leave this null for now</param>
        /// <param name="stage">The exact text of any stage within the Stage select element on the Add Observation form</param>
        /// <param name="epa">The exact text of any EPA underneath the Stage select element</param>
        /// <param name="observationTool">The exact text of any observation tool underneath the EPAs on this form</param>
        /// <returns>An object that represents the learner, the stage, epa, observation tool, and also the completed observation details</returns>
        // TODO: Implement Narrative observation type. Make another method where the selection of stage, epa and observation tool are random selections (AddRandomObservation).
        public AddedObservationInfo AddObservation(string learnerFullName, string observationType, string stage, string epa, string observationTool)
        {
            //AddObservationObject AOO = new AddObservationObject("", "", "", );

            // If the form is not open, then open it.
            if (!Browser.Exists(Bys.CBDObserverPage.AddObsFormLearnerNameTxt, ElementCriteria.IsVisible))
            {
                ClickAndWait(AddObservationBtn);
            }

            SearchAndSelectLearnerOnAddObservationForm(learnerFullName);
            ClickAndWait(AddObsFormNextBtn);

            ElemSet.RdoBtn_ClickByText(Browser, "EPA/IM Observation");
            ClickAndWait(AddObsFormNextBtn);

            AddObsFormStageSelElem.SelectByText(stage);
            Browser.WaitForElement(Bys.CBDObserverPage.AddObsFormBackBtn, ElementCriteria.IsVisible, ElementCriteria.IsEnabled, ElementCriteria.HasText);
            this.WaitForInitialize();

            ElemSet.RdoBtn_ClickByText(Browser, epa);
            Browser.WaitForElement(Bys.CBDObserverPage.AddObsFormBackBtn, ElementCriteria.IsVisible, ElementCriteria.IsEnabled, ElementCriteria.HasText);
            this.WaitForInitialize();

            ElemSet.RdoBtn_ClickByText(Browser, observationTool);
            AddObsFormNextBtn.Click();
            Browser.WaitForElement(Bys.CBDObserverPage.CompleteAssessFormFeedbackTxt, ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
            this.WaitForInitialize();

            // Fill out the observation form and return the values that were chosen
            CompletedAssessmentInfo assessment = FillObservationFieldsOnFormToCompleteAssessment();

            ClickAndWait(CompleteAssessFormSubmitBtn);

            return(new AddedObservationInfo(learnerFullName, stage, observationTool, assessment));
        }
 /// <summary>
 /// Enters text into the Learner Name field on the Add Observation form, clicks the Search button, then selects
 /// a learner from the list of radio buttons
 /// </summary>
 /// <param name="learnerFullName">The first and last name of the learner</param>
 private void SearchAndSelectLearnerOnAddObservationForm(string learnerFullName)
 {
     AddObsFormLearnerNameTxt.SendKeys(learnerFullName);
     ClickAndWait(AddObsFormSearchBtn);
     ElemSet.RdoBtn_ClickByText(Browser, learnerFullName);
 }
 /// <summary>
 /// Clicks on either Certification Type radio button, then waits a second
 /// </summary>
 /// <param name="certType"></param>
 public void SelectCertTypeRadioButton(string certType)
 {
     ElemSet.RdoBtn_ClickByText(Browser, certType);
     Thread.Sleep(2000);
 }