Example #1
0
        public bool SectionIsVisible()
        {
            WaitFor.AjaxCallsToComplete();
            var sectionIdDiv = Find.OptionalElement(By.ClassName("current-section-list-item"));

            return(sectionIdDiv != null);
        }
 public void AwaitInitialisation()
 {
     WaitFor.AjaxCallsToComplete(new TimeSpan(0, 0, 2));
     while (Browser.IsThisStatusPage())
     {
         Thread.Sleep(TimeSpan.FromSeconds(5));
     }
 }
        public void EnterEmail(string email) => Find.Element(By.Id(EmailField)).SendKeys(email); //had to use send keys to simulate typing.

        public TPage SubmitEmail <TPage>(string email)
            where TPage : UiComponent, new()
        {
            EnterEmail(email);
            var navPage = NavigateTo <TPage>(By.ClassName(SendButton));

            WaitFor.AjaxCallsToComplete(new TimeSpan(0, 0, 2));
            return(navPage);
        }
Example #4
0
 public ProfilePage EditName(NameModel nameModel)
 {
     Execute.Script("$('#edit-student-name-button').click()");
     Execute.Script("$('#FirstName').val('" + nameModel.FirstName + "')");
     Execute.Script("$('#LastName').val('" + nameModel.LastName + "')");
     Execute.Script("$('#save-student-name-edit').click()");
     WaitFor.AjaxCallsToComplete();
     return(this);
 }
Example #5
0
        public void Edit(EditAcademicDetailModel academicDetailModel)
        {
            Execute.Script("$('#AcademicDetail_MathScore').val('" + academicDetailModel.MathScore + "')");
            Execute.Script("$('#AcademicDetail_ReadingScore').val('" + academicDetailModel.ReadingScore + "')");
            Execute.Script("$('#AcademicDetail_WritingScore').val('" + academicDetailModel.WritingScore + "')");
            Execute.Script("$('#AcademicDetail_PerformanceHistory').val('" + academicDetailModel.PerformanceHistory + "')");

            Find.Element(By.Id("save-academic-details-edit")).Click();
            WaitFor.AjaxCallsToComplete();
        }
Example #6
0
        public bool EditedBiographicalInformationIsVisable(EditableStudentBiographicalInfoModel newBiographicalInformation)
        {
            WaitFor.AjaxCallsToComplete();
            var sex      = Browser.PageSource.Contains(newBiographicalInformation.Sex.Humanize());
            var birthday = Browser.PageSource.Contains(newBiographicalInformation.BirthDate);
            var latino   = Browser.PageSource.Contains(newBiographicalInformation.HispanicLatinoEthnicity.ToString());
            var race     = Browser.PageSource.Contains(newBiographicalInformation.Race.Humanize());
            var language = Browser.PageSource.Contains(newBiographicalInformation.HomeLanguage.ToString());

            return(sex && birthday && language && latino && race);
        }
Example #7
0
        public void Edit(HomeAddressModel homeAddressModel)
        {
            Execute.Script("$('#Address').val('" + homeAddressModel.Address + "')");
            Execute.Script("$('#Address2').val('" + homeAddressModel.Address2 + "')");
            Execute.Script("$('#City').val('" + homeAddressModel.City + "')");
            Execute.Script("$('#State').val('" + homeAddressModel.State + "')");
            Execute.Script("$('#PostalCode').val('" + homeAddressModel.PostalCode + "')");

            Find.Element(By.Id("save-home-address-edit")).Click();
            WaitFor.AjaxCallsToComplete();
        }
Example #8
0
 private ProfilePage InputBiographicalInfoValues(ProfileModel profileModel)
 {
     WaitFor.AjaxCallsToComplete();
     Execute.Script("$('#Sex').val('" + profileModel.BiographicalInfo.Sex + "')");
     Execute.Script("$('#BirthDate').val('" + profileModel.BiographicalInfo.BirthDate + "')");
     Execute.Script("$('#HispanicLatinoEthnicity').attr('checked'," +
                    profileModel.BiographicalInfo.HispanicLatinoEthnicity.ToString().ToLower() + ")");
     Execute.Script("$('#Race').val('" + profileModel.BiographicalInfo.Race + "')");
     Execute.Script("$('#HomeLanguage').val('" + profileModel.BiographicalInfo.HomeLanguage + "')");
     Execute.Script("$('#save-biographical-info-edit').click()");
     return(this);
 }
Example #9
0
        public void Edit(int parentNumber, EditProfileParentModel parentModel)
        {
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #FirstName').val('" + parentModel.FirstName + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #LastName').val('" + parentModel.LastName + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #Sex').val('" + parentModel.Sex + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #Relationship').val('" + parentModel.Relationship + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #TelephoneNumber').val('" + parentModel.TelephoneNumber + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #EmailAddress').val('" + parentModel.EmailAddress + "')");
            Execute.Script("$('#editable-parent-" + parentNumber + "-info #SameAddressAsStudent').click()");
            if (!parentModel.SameAddressAsStudent)
            {
                Execute.Script("$('#editable-parent-" + parentNumber + "-info #EditableParentAddressModel_Address').val('" + parentModel.EditableParentAddressModel.Address + "')");
                Execute.Script("$('#editable-parent-" + parentNumber + "-info #EditableParentAddressModel_Address2').val('" + parentModel.EditableParentAddressModel.Address2 + "')");
                Execute.Script("$('#editable-parent-" + parentNumber + "-info #EditableParentAddressModel_City').val('" + parentModel.EditableParentAddressModel.City + "')");
                Execute.Script("$('#editable-parent-" + parentNumber + "-info #EditableParentAddressModel_State').val('" + parentModel.EditableParentAddressModel.State + "')");
                Execute.Script("$('#editable-parent-" + parentNumber + "-info #EditableParentAddressModel_PostalCode').val('" + parentModel.EditableParentAddressModel.PostalCode + "')");
            }

            Execute.Script("$('#save-parent-" + parentNumber + "-info-edit').click()");
            WaitFor.AjaxCallsToComplete();
        }
 public FormWithAJAXPage WaitForAjaxCallsToComplete()
 {
     WaitFor.AjaxCallsToComplete();
     return(this);
 }
Example #11
0
        public List <string> GetSections()
        {
            WaitFor.AjaxCallsToComplete();

            return(Find.Elements(By.ClassName("section-id")).Select(we => we.Text).ToList());
        }