public ComponentScopeLocateResult Find(IWebElement scope, ComponentScopeLocateOptions options, SearchOptions searchOptions) { int?columnIndex = GetColumnIndex(scope, options, searchOptions); if (columnIndex == null) { if (searchOptions.IsSafely) { return(new MissingComponentScopeLocateResult()); } else { throw ExceptionFactory.CreateForNoSuchElement( new SearchFailureData { ElementName = $"\"{options.GetTermsAsString()}\" column header", SearchOptions = searchOptions, SearchContext = scope }); } } IComponentScopeLocateStrategy nextStrategy = CreateColumnIndexStrategy(columnIndex.Value); return(new SequalComponentScopeLocateResult(scope, nextStrategy)); }
private static void InitComponentLocator(UIComponent component, UIComponentMetadata metadata, FindAttribute findAttribute) { ComponentScopeLocateOptions locateOptions = CreateScopeLocateOptions(metadata, findAttribute); IComponentScopeLocateStrategy strategy = findAttribute.CreateStrategy(metadata); component.ScopeSource = findAttribute.ScopeSource; if (component is IItemsControl itemsControl) { IFindItemAttribute findItemAttribute = GetPropertyFindItemAttribute(metadata); IItemElementFindStrategy itemElementFindStrategy = findItemAttribute.CreateStrategy(component, metadata); itemsControl.Apply(itemElementFindStrategy); } component.ScopeLocator = new StrategyScopeLocator(component, strategy, locateOptions); }
private static void InitComponentLocator(UIComponent component, UIComponentMetadata metadata, FindAttribute findAttribute) { ComponentScopeLocateOptions locateOptions = CreateScopeLocateOptions(metadata, findAttribute); IComponentScopeLocateStrategy strategy = findAttribute.CreateStrategy(metadata); component.ScopeSource = findAttribute.ScopeSource; // TODO: Remove this condition when IItemsControl will be removed. #pragma warning disable CS0618 if (component is IItemsControl itemsControl) #pragma warning restore CS0618 { IFindItemAttribute findItemAttribute = GetPropertyFindItemAttribute(metadata); IItemElementFindStrategy itemElementFindStrategy = findItemAttribute.CreateStrategy(component, metadata); itemsControl.Apply(itemElementFindStrategy); } component.ScopeLocator = new StrategyScopeLocator(component, strategy, locateOptions); }
private XPathComponentScopeLocateResult[] ExecuteStrategyAndResolveResults(IComponentScopeLocateStrategy strategy, IWebElement scope, ComponentScopeLocateOptions options, SearchOptions searchOptions) { ComponentScopeLocateResult result = strategy.Find(scope, options, searchOptions); return(ResolveScopeLocateResult(result, scope, searchOptions)); }
public StrategyScopeLocator(UIComponent component, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions) { this.component = component; this.strategy = strategy; this.scopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(IWebElement scopeSource, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) { ScopeSource = scopeSource; Strategy = strategy; ScopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(By scopeSourceBy, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) { ScopeSourceBy = scopeSourceBy; Strategy = strategy; ScopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(IEnumerable <IWebElement> scopeSources, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) { ScopeSources = scopeSources; Strategy = strategy; ScopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(IWebElement scopeSource, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) : this(new[] { scopeSource ?? throw new ArgumentNullException(nameof(scopeSource)) }, strategy, scopeLocateOptions)
public StrategyScopeLocator(UIComponent component, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions) { this.component = component; this.strategy = strategy; this.scopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(IWebElement scopeSource, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) { ScopeSource = scopeSource; Strategy = strategy; ScopeLocateOptions = scopeLocateOptions; }
public SequalComponentScopeLocateResult(By scopeSourceBy, IComponentScopeLocateStrategy strategy, ComponentScopeLocateOptions scopeLocateOptions = null) { ScopeSourceBy = scopeSourceBy; Strategy = strategy; ScopeLocateOptions = scopeLocateOptions; }