public static void Input <T>(this IElementContainer container, Expression <Func <T, object> > input, object value) { var id = GetElementName(input); if (value is DateTime) { var calendareButton = TryFindCalendareButton(container, id); if (calendareButton == null) { container.TextField(Find.ById((string)id)).Value = value.ToString(); } else { EnterIntoCalendar(calendareButton, (DateTime)value); } } else if (value is bool) { container.CheckBox(Find.ById((string)id)).Checked = (bool)value; } else { container.TextField(Find.ById((string)id)).Value = value.ToString(); } }
private void RegisterUserWithAddress(Client client, IElementContainer browser) { ClickLink("Новый пользователь"); browser.CheckBox(Find.ByName("sendClientCard")).Checked = true; browser.TextField(Find.ByName("mails")).TypeText("*****@*****.**"); browser.TextField(Find.ByName("address.Value")).TypeText("TestAddress"); FillRequiredFields(); }
public static IElementContainer FillCheckbox(this IElementContainer container, Constraint findBy, bool value) { var element = container.CheckBox(findBy); if (element.Exists && element.Checked != value) { element.Click(); } return(container); }
public static void SetCheked(this IElementContainer b, string name, bool chek) { b.CheckBox(Find.ByName(name)).SetChecked(chek, false); }