/// <summary> /// On backoffice/bulk-buys/not completed not deleted page checks all the records is the draw date is not in past /// </summary> public void IfPastDrawDateIsPresent() { _commonActions.SignIn_in_admin_panel(); _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/bulk_buys?scope=not_completed_not_deleted"); BulkBuysPageObj bulkBuys = new BulkBuysPageObj(_driver); StringBuilder buildReport = new StringBuilder(); int pages = bulkBuys.NumberOfPages; for (int j = 1; j <= pages; ++j) { bulkBuys.NavigateToPage(j); for (int i = 1; i < bulkBuys.NumberOfRecordsOnPage; ++i) { try { DateTime date = bulkBuys.DrawDate(i); if (date.Date < DateTime.Today) { buildReport.Append("\n Record №" + i + " on page " + j + " has a past draw date. So the bet was not pushed to the next draw. \n"); } } catch (Exception e) { buildReport.Append( "\n Record " + i + " has incorrect type of data at all (empty string or not a data format). " + "You should check it on page" + j + " \n"); } } } if (buildReport.Length > 0) { throw new Exception(buildReport.ToString()); } }