public static void SetTimeRange(this DayEditingBlock block, string start = "10:00", string end = "21:00", int atRow = 0) { while (block.TimeRangeLine.Count.Get() <= atRow && block.TimeRangeLine.First().AddLink.IsPresent.Get()) { block.TimeRangeLine.First().AddLink.Click(); } var timeRange = block.GetTimeRangeBlockAtIndex(atRow); timeRange.StartTime.ResetRawValue(start); timeRange.EndTime.ResetRawValue(end); }
protected void OpenValidation(DayEditingBlock editingView, PresenceBy presenceBy) { if (presenceBy == PresenceBy.Submit) { editingView.Save.Click(); } else { editingView.ClickOnFakeBlock(); } }
public static void CheckTimeRange(this DayEditingBlock block, string start, string end, string overflow = null, int atRow = 0) { var timeRange = block.GetTimeRangeBlockAtIndex(atRow); timeRange.StartTime.WaitText(start); timeRange.EndTime.WaitText(end); if (!string.IsNullOrEmpty(overflow)) { timeRange.OverflowText.WaitText(overflow); } if (overflow == "") { timeRange.OverflowText.WaitAbsence(); } }
protected void CheckValidationMessage(DayEditingBlock editingView, string message, ErrorAt errorAt, int atRow = 0) { var timeRange = editingView.GetTimeRangeBlockAtIndex(atRow); if (errorAt == ErrorAt.Both) { timeRange.StartTime.MouseOver(); timeRange.CheckErrorMessage(message, false); editingView.ClickOnFakeBlock(); timeRange.EndTime.MouseOver(); timeRange.CheckErrorMessage(message, true); } else { timeRange.MouseOverTimeInput(errorAt == ErrorAt.Right); timeRange.CheckErrorMessage(message, errorAt == ErrorAt.Right); } editingView.ClickOnFakeBlock(); }
public static TimeRangeLine GetTimeRangeBlockAtIndex(this DayEditingBlock block, int index) { block.TimeRangeLine.Count.Wait().MoreOrEqual(index + 1); return(block.TimeRangeLine.ElementAt(index)); }
public static void ClickOnFakeBlock(this DayEditingBlock block) { block.FakeBlock.Container.Click(); }
public static void ClickCancel(this DayEditingBlock block) { block.Cancel.Click(); block.WaitAbsence(); }
public static void ClickSave(this DayEditingBlock block) { block.Save.Click(); block.WaitAbsence(); }
public static void SetCalendarMode(this DayEditingBlock block, CalendarFillingMode mode) { block.CalendarMode.SelectByIndex((int)mode); }
public static void CheckTimeRange(this DayEditingBlock block, int start, int end, string overflow = null, int atRow = 0) { block.CheckTimeRange($"{(start > 9 ? "" : "0")}{start}:00", $"{(end > 9 ? "" : "0")}{end}:00", overflow, atRow); }