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 CheckSelectedTextContain(
     [NotNull] IWebElementWrapper element,
     [NotNull] string behavior,
     [NotNull] string value)
 {
     Assert.ShouldBecome(() => element.Text.Contains(value), !behavior.Contains("not"),
                         $"{element.Caption} text is \"{element.Text}\"");
 }
 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 GetElementTextOrValue(IWebElementWrapper element)
 {
     if (element.GetAttribute("value") == null)
     {
         return(element.Text);
     }
     return(element.GetAttribute("value"));
 }
 public void HoverMouse(IWebElementWrapper element)
 {
     element.MouseHover();
 }
 public void ClickThreeTimes([NotNull] IWebElementWrapper element)
 {
     element.Click();
     element.Click();
     element.Click();
 }
 public void ClickTwice([NotNull] IWebElementWrapper element)
 {
     element.Click();
     element.Click();
 }
 public void CheckElementIsEmpty([NotNull] IWebElementWrapper element, AssertionBehavior behavior)
 {
     Assert.ShouldBecome(() => StringExtensions.GetElementTextOrValue(element), string.Empty, behavior,
                         $"{element.Caption} text is \"{StringExtensions.GetElementTextOrValue(element)}\"");
 }
示例#10
0
 public void CheckSearchResultEmptyByColumn(ITableWrapper table, IWebElementWrapper column)
 {
     Assert.ShouldBecome(() => !column.Displayed && !table.Rows.Any(), true, $"{table.Caption} contains records");
 }
示例#11
0
 public void CheckElementShown([NotNull] IWebElementWrapper element, [NotNull] AssertionBehavior behavior)
 {
     Assert.ShouldBecome(() => element.Displayed, true, behavior, $"{element.Caption} is{behavior.BehaviorAppendix()} visible");
 }