public void CheckElementIsDisabled( [NotNull] IWebElementWrapper element, [NotNull] AssertionBehavior behavior, bool enabled) { Assert.ShouldBecome(() => element.Enabled, enabled, behavior, $"{element.Caption} is{behavior.BehaviorAppendix()} enabled"); }
public void CheckElementTooltip( [NotNull] IWebElementWrapper element, [NotNull] AssertionBehavior behavior, [NotNull] string value) { Assert.ShouldBecome(() => element.Tooltip, value, behavior, $"{element.Caption} tooltip is \"{element.Tooltip}\""); }
public void CheckSelectedText( [NotNull] IWebElementWrapper element, [NotNull] AssertionBehavior behavior, [NotNull] string value) { Assert.ShouldBecome(() => StringExtensions.GetElementTextOrValue(element), value, behavior, $"{element.Caption} text is \"{StringExtensions.GetElementTextOrValue(element)}\""); }
public static string BehaviorAppendix(this AssertionBehavior behavior) { if (!behavior.Inversion) { return(" not"); } return(string.Empty); }
public static void ShouldBecome <T>(this Func <T> predicate, T value, AssertionBehavior behavior, string message) { if (behavior.Type == AssertionType.Immediate) { var actualValue = TryGetValue(predicate, TimeSpan.FromMilliseconds(500)); True(actualValue.Equals(value) == !behavior.Inversion, message); } else { ShouldBecome(predicate, value, message, !behavior.Inversion); } }
public void CheckSelectedValue([NotNull] IDropdownWrapper wrapper, AssertionBehavior behavior, [NotNull] string value) { Assert.ShouldBecome(() => wrapper.SelectedValue, value, behavior, $"{wrapper.Caption} selected value is{behavior.BehaviorAppendix()} {value}"); }
public void CheckDropdownIsEmpty([NotNull] IDropdownWrapper wrapper, [NotNull] AssertionBehavior behavior) { Assert.ShouldBecome(() => wrapper.Empty, true, behavior, $"{wrapper.Caption} selected value is{behavior.BehaviorAppendix()} empty"); }
public void CheckElementIsEmpty([NotNull] IWebElementWrapper element, AssertionBehavior behavior) { Assert.ShouldBecome(() => StringExtensions.GetElementTextOrValue(element), string.Empty, behavior, $"{element.Caption} text is \"{StringExtensions.GetElementTextOrValue(element)}\""); }
public void CheckRelativeUrl([NotNull] AssertionBehavior behavior, [NotNull] string url) { Assert.ShouldBecome(() => new Uri(_driverService.CurrentUrl).PathAndQuery, url, behavior, $"relative URL is {new Uri(_driverService.CurrentUrl).PathAndQuery}"); }
public void CheckUrl([NotNull] string url, [NotNull] AssertionBehavior behavior) { Assert.ShouldBecome(() => _driverService.CurrentUrl, url, behavior, $"current URL is {_driverService.CurrentUrl}"); }
public void CheckPageTitle([NotNull] AssertionBehavior behavior, [CanBeNull] string title) { Assert.ShouldBecome(() => _driverService.Title, title, behavior, $"page title is {_driverService.Title}"); }
public void CheckElementShown([NotNull] IWebElementWrapper element, [NotNull] AssertionBehavior behavior) { Assert.ShouldBecome(() => element.Displayed, true, behavior, $"{element.Caption} is{behavior.BehaviorAppendix()} visible"); }