private void CreateExceptionalCircumstance(string description, string startdate, string enddate) { //Delete any Existing Exceptional Circumstance ExceptionalCircumstancesTriplet exceptionalCircumstancesTriplet = new ExceptionalCircumstancesTriplet(); exceptionalCircumstancesTriplet.SearchCriteria.StartDate = startdate; exceptionalCircumstancesTriplet.SearchCriteria.EndDate = enddate; var exCirResults = exceptionalCircumstancesTriplet.SearchCriteria.Search(); if (SearchResults.SearchResultCount != 0) { SearchResults.SelectSearchResult(0); ExceptionalCircumstancesDetailPage page1 = new ExceptionalCircumstancesDetailPage(); page1.Delete(); } exceptionalCircumstancesTriplet.Create(); ExceptionalCircumstancesDetailPage page = exceptionalCircumstancesTriplet.SelectWholeSchool(); page.Description = description; page.StartDate = startdate; page.EndDate = enddate; page.SessionStart = "AM"; page.SessionEnd = "PM"; exceptionalCircumstancesTriplet.ConfirmAndSave(); }
public void SearchAndEditExceptionalCircumstancesForWholeSchool(string description, string startdate, string enddate) { var exceptionalCircumstancesTriplet = AttendanceNavigations.NavigateToExceptionalCircumstancePageFromTaskMenu(); // Create Exceptional Cirumstance CreateExceptionalCircumstance(description, startdate, enddate); //Search for existing Exceptional cirumstance exceptionalCircumstancesTriplet.SearchCriteria.StartDate = startdate; exceptionalCircumstancesTriplet.SearchCriteria.EndDate = enddate; var exCirResults = exceptionalCircumstancesTriplet.SearchCriteria.Search(); var page = exCirResults.FirstOrDefault(x => x.Name.Trim().Equals(description)).Click <ExceptionalCircumstancesDetailPage>(); Assert.AreNotEqual(null, exCirResults.FirstOrDefault(x => x.Name.Trim().Equals(description))); //Edit existing Exceptional cirumstance page.Description = description + SeleniumHelper.GenerateRandomString(10); page.StartDate = startdate; page.EndDate = enddate; var ecpage = new ExceptionalCircumstancesTriplet(); ecpage.ConfirmAndSave(); Assert.IsTrue(ecpage.HasConfirmedSave()); //Delete Exceptional Circumstances if existed page.Delete(); }