public static void SelectTab(this ILineContainer lineContainer, string eventKey) { var element = lineContainer.Element.WaitElementVisible(By.CssSelector($"a.nav-item[data-rb-event-key={eventKey}]")); element.ScrollTo(); element.Click(); }
public static EntityListCheckBoxProxy EntityListCheckBox <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property) where T : IModifiableEntity { var lineLocator = lineContainer.LineLocator(property); return(new EntityListCheckBoxProxy(lineLocator.ElementLocator.WaitVisible(), lineLocator.Route)); }
public static QueryTokenBuilderProxy QueryTokenBuilder <T>(this ILineContainer <T> lineContainer, Expression <Func <T, QueryTokenEmbedded> > property) where T : IModifiableEntity { var lineLocator = lineContainer.LineLocator(property); return(new QueryTokenBuilderProxy(lineLocator.ElementLocator.WaitVisible())); }
public static V EntityLineValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property) where T : IModifiableEntity { var lite = lineContainer.EntityLine(property).GetLite(); return(lite is V ? (V)lite : (V)(object)lite?.RetrieveAndRemember() !); }
public static LineLocator <S> LineLocator <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property) where T : IModifiableEntity { PropertyRoute route = lineContainer.Route ?? PropertyRoute.Root(typeof(T)); var element = lineContainer.Element; foreach (var mi in Reflector.GetMemberList(property)) { if (mi is MethodInfo && ((MethodInfo)mi).IsInstantiationOf(MixinDeclarations.miMixin)) { route = route.Add(((MethodInfo)mi).GetGenericArguments()[0]); } else { var newRoute = route.Add(mi); if (newRoute.Parent != route && route != lineContainer.Route) { element = element.FindElement(By.CssSelector("[data-property-path='" + route.PropertyString() + "']")); } route = newRoute; } } return(new LineLocator <S>( elementLocator: element.WithLocator(By.CssSelector("[data-property-path='" + route.PropertyString() + "']")), route: route )); }
public static FileLineProxy FileLine <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property) where T : ModifiableEntity { var lineLocator = lineContainer.LineLocator(property); return(new FileLineProxy(lineLocator.ElementLocator.WaitVisible(), lineLocator.Route)); }
public static V EntityComboValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property) where T : ModifiableEntity { var lite = lineContainer.EntityCombo(property).LiteValue; return(lite is V ? (V)lite : (V)(object)lite.Retrieve()); }
public static void SelectTab(this ILineContainer lineContainer, string eventKey) { var element = lineContainer.Element.WaitElementVisible(By.CssSelector($".nav-tabs .nav-item .nav-link[data-rr-ui-event-key='{eventKey}']")); element.ScrollTo(); element.Click(); }
public static void SelectTab(this ILineContainer lineContainer, string tabId) { var fullTabId = lineContainer.PrefixUnderscore() + tabId; lineContainer.Selenium.FindElement(By.CssSelector("a[href='#{0}']".FormatWith(fullTabId))).Click(); lineContainer.Selenium.Wait(() => lineContainer.Selenium.IsElementVisible(By.Id(fullTabId))); }
public static string[] Errors(this ILineContainer lineContainer) { var result = (string)lineContainer.Selenium .ExecuteScript("return $('#" + lineContainer.PrefixUnderscore() + "sfGlobalValidationSummary > ul > li').toArray().map(function(e){return $(e).text()}).join('\\r\\n');"); return(result.SplitNoEmpty("\r\n")); }
public static SearchControlProxy GetSearchControl(this ILineContainer lineContainer, object queryName) { string queryKey = QueryUtils.GetKey(queryName); var element = lineContainer.Element.WaitElementVisible(By.CssSelector("div.sf-search-control[data-query-key={0}]".FormatWith(queryKey))); return(new SearchControlProxy(element)); }
public static LineContainer <S> SubContainer <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property) where T : IModifiableEntity where S : IModifiableEntity { var lineLocator = lineContainer.LineLocator(property); return(new LineContainer <S>(lineLocator.ElementLocator.WaitVisible(), lineLocator.Route)); }
public static DetailGridProxy DetailGrid(this ILineContainer <OrderEntity> container) { PropertyRoute route = container.GetRoute((OrderEntity o) => o.Details); var grid = container.Element.Element(TreeScope.Descendants, a => a.Current.ClassName == "ImmediateGrid" && a.Current.Name == route.ToString()); return(new DetailGridProxy(grid)); }//DetailGrid
public static ILineContainer <S> EntityDetailControl <T, S>(this ILineContainer <T> container, Expression <Func <T, S> > property, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity where S : ModifiableEntity { PropertyRoute route = container.GetRoute(property); return(container.EntityDetail(route, scope).GetDetailControl <S>()); }
public static ValueSearchControlLineProxy GetValueSearchControlLine(this ILineContainer lineContainer, object queryName) { string queryKey = QueryUtils.GetKey(queryName); var element = lineContainer.Element.WaitElementVisible(By.CssSelector("[data-value-query-key={0}]".FormatWith(queryKey))); return(new ValueSearchControlLineProxy(element)); }
public static V EntityComboValue <T, V>(this ILineContainer <T> container, Expression <Func <T, V> > property, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity { PropertyRoute route = container.GetRoute(property); var lite = container.EntityCombo(route, scope).LiteValue; return(lite is V ? (V)lite : (V)lite.Retrieve()); }
public static SearchControlProxy GetSearchControl(this ILineContainer lineContainer, object queryName) { string query = QueryUtils.GetKey(queryName); var prefix = (string)lineContainer.Selenium.ExecuteScript("return $('div.sf-search-control[data-queryname=\"{0}\"]').data('prefix')".FormatWith(query)); return(new SearchControlProxy(lineContainer.Selenium, prefix)); }
public static ValueLineProxy ValueLine <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property) where T : ModifiableEntity { string newPrefix; PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix); return(new ValueLineProxy(lineContainer.Selenium, newPrefix, newRoute)); }
public static bool HasError <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property) where T : ModifiableEntity { string newPrefix; PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix); return(lineContainer.Selenium.HasError(newPrefix)); }
public static QueryTokenBuilderProxy QueryTokenBuilder <T>(this ILineContainer <T> lineContainer, Expression <Func <T, QueryTokenEmbedded> > property) where T : ModifiableEntity { string newPrefix; PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix); return(new QueryTokenBuilderProxy(lineContainer.Selenium, newPrefix + "_")); }
public static LineContainer <S> SubContainer <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property) where T : ModifiableEntity where S : ModifiableEntity { string newPrefix; PropertyRoute newRoute = lineContainer.GetRoute(property, out newPrefix); return(new LineContainer <S>(lineContainer.Selenium, newPrefix, newRoute)); }
public static string PrefixUnderscore(this ILineContainer lineContainer) { if (lineContainer.Prefix.HasText()) { return(lineContainer.Prefix + "_"); } return(""); }
public static PropertyRoute GetRoute <T, S>(this ILineContainer <T> container, Expression <Func <T, S> > property) where T : ModifiableEntity { PropertyRoute result = container.PreviousRoute ?? PropertyRoute.Root(typeof(T)); foreach (var mi in Reflector.GetMemberList(property)) { result = result.Add(mi); } return(result); }
public static void ValueLineValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property, V value, bool loseFocus = false) where T : ModifiableEntity { var valueLine = lineContainer.ValueLine(property); valueLine.Value = value; if (loseFocus) { lineContainer.Selenium.LoseFocus(valueLine.MainElement()); } }
public static void EntityComboValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property, V value, bool loseFocus = false) where T : ModifiableEntity { var combo = lineContainer.EntityCombo(property); combo.LiteValue = value as Lite <IEntity> ?? ((IEntity)value)?.ToLite(); if (loseFocus) { lineContainer.Selenium.LoseFocus(lineContainer.Selenium.FindElement(combo.ComboLocator)); } }
public static void ValueLineValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property, V value, bool loseFocus = false) where T : IModifiableEntity { var valueLine = lineContainer.ValueLine(property); valueLine.SetValue(value); if (loseFocus) { valueLine.EditableElement.Find().LoseFocus(); } }
public static void EntityComboValue <T, V>(this ILineContainer <T> lineContainer, Expression <Func <T, V> > property, V value, bool loseFocus = false) where T : IModifiableEntity { var combo = lineContainer.EntityCombo(property); combo.LiteValue = value as Lite <IEntity> ?? ((IEntity?)value)?.ToLite(); if (loseFocus) { combo.ComboElement.WrappedElement.LoseFocus(); } }
public static ILineContainer <C> SubContainer <T, C>(this ILineContainer <T> container, Expression <Func <T, C> > property, TreeScope scope = TreeScope.Descendants) where T : ModifiableEntity where C : ModifiableEntity { PropertyRoute route = property.Body.NodeType != ExpressionType.Convert ? container.GetRoute(property) : container.GetRoute(Expression.Lambda <Func <T, IEntity> >(((UnaryExpression)property.Body).Operand, property.Parameters)); string str = route.PropertyRouteType == PropertyRouteType.LiteEntity ? route.Parent.ToString() : route.ToString(); var subContainer = container.Element.Element(scope, a => a.Current.Name == str); return(new LineContainer <C> { Element = subContainer, PreviousRoute = typeof(C).IsEmbeddedEntity() ? route : null }); }
public static PropertyRoute GetRoute <T, S>(this ILineContainer <T> lineContainer, Expression <Func <T, S> > property, out string newPrefix) where T : ModifiableEntity { newPrefix = lineContainer.Prefix; PropertyRoute result = lineContainer.Route ?? PropertyRoute.Root(typeof(T)); foreach (var mi in Reflector.GetMemberList(property)) { if (mi is MethodInfo && ((MethodInfo)mi).IsInstantiationOf(MixinDeclarations.miMixin)) { result = result.Add(((MethodInfo)mi).GetGenericArguments()[0]); } else { result = result.Add(mi); if (newPrefix.HasText()) { newPrefix += "_"; } newPrefix += mi.Name; } } return(result); }
public static SearchControlProxy GetSearchControlSuffix(this ILineContainer lineContainer, string suffix) { return(new SearchControlProxy(lineContainer.Selenium, lineContainer.PrefixUnderscore() + suffix)); }