public static PageElement GetElementByAlias(PageCore page, PageElement currentElement, string alias) { if (page == null) { throw new ArgumentException("Страница на которой происходит поиск не может иметь пустое значение"); } PageElementCore elementCore = null; if (currentElement != null && currentElement.TryFindElementByAlias(alias, out elementCore)) { PageElement element = elementCore as PageElement; if (element != null) { return(element); } } if (page.TryFindElementByAlias(alias, out elementCore)) { PageElement element = elementCore as PageElement; if (element != null) { return(element); } } string xPath = Alias.ResolveAsString(alias); return(page.FindElement(xPath)); }
public static PageElementCollection GetElementCollectionByAlias(PageCore page, PageElement currentElement, string groupAlias) { if (page == null) { throw new ArgumentException("Страница на которой происходит поиск не может иметь пустое значение"); } PageElementCore element = null; if (currentElement != null && currentElement.TryFindElementByAlias(groupAlias, out element)) { PageElementCollection collection = element as PageElementCollection; if (collection != null) { return(collection); } } if (page.TryFindElementByAlias(groupAlias, out element)) { PageElementCollection collection = element as PageElementCollection; if (collection != null) { return(collection); } } string xPath = Alias.ResolveAsString(groupAlias); return(page.FindElementCollection(xPath)); }
public static PageElementCollection GetElementCollectionByAlias(string groupAlias) { PageCore currentPage = ScenarioContext.Current.Page(); PageElement currentElement = ScenarioContext.Current.Element(); PageElementCollection element = GetElementCollectionByAlias(currentPage, currentElement, groupAlias); return(element); }
public static PageElement GetElementByAlias(string alias) { PageCore currentPage = ScenarioContext.Current.Page(); PageElement currentElement = ScenarioContext.Current.Element(); PageElement element = PageElement.GetElementByAlias(currentPage, currentElement, alias); return(element); }
public static PageCore TryResolveAsPage(string pageAlias) { PageCore page = null; Type pageType = null; if (!Alias.PageAliases.TryGetValue(pageAlias, out pageType)) { return(null); } page = Activator.CreateInstance(pageType) as PageCore; return(page); }
public PageElementCollection(PageCore page, string xPath) : base(page, xPath) { }
//[AAAStep("TryResolveAsPage")] public static void SetPage(this ScenarioContext context, PageCore page) { context[CURRENT_PAGE_KEY] = page; }
public PageElement(PageCore page, string xPath) : base(page, xPath) { }
public PageElementCore(PageCore page, string xPath) { this.Page = page; this.XPath = xPath; }