/// <summary> /// Fills in report period details and click create. /// </summary> public void FillInReportPeriodDetailsAndClickCreate() { var dateString = BeginsOn.Text; var endDate = PageHelper.ConvertDateToFormat(dateString, "dd/MM/yyyy"); var eDate = endDate.AddDays(2).ToString("dd/MM/yyyy"); Name.SendKeys(endDate.ToString("dd/MM") + " - " + eDate.Substring(0, 5)); Description.SendKeys(rDescription); Driver.ExecuteJavaScript(@"$('#EndsOn').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#SubmissionDueDate').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#PaymentDate').val('" + eDate + "')"); CalendarYear.Clear(); CalendarYear.SendKeys(endDate.Year.ToString()); FiscalYear.Clear(); FiscalYear.SendKeys(endDate.Year.ToString()); CreateReportingPeriodButton.Click(); BackToList.Click(); }
/// <summary> /// Search and edit the report period. /// </summary> public void SearchAndEditTheReportPeriod() { ReportPeriodSearch.SendKeys(rDescription); EditButton.Click(); var dateString = EditedBeginsOn.GetAttribute("value"); var endDate = PageHelper.ConvertDateToFormat(dateString, "dd/MM/yyyy"); var eDate = endDate.AddDays(2).ToString("dd/MM/yyyy"); Description.Clear(); Description.SendKeys("Edited" + rDescription); Driver.ExecuteJavaScript(@"$('#EndsOn').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#SubmissionDueDate').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#PaymentDate').val('" + eDate + "')"); CalendarYear.SendKeys("2018"); FiscalYear.SendKeys("2018"); SaveReportingPeriodButton.Click(); BackToList.Click(); }