private void SetName(FieldInfo viElement, ref VIElement instance)
        {
            var nameAttr = NameAttribute.GetName(viElement);

            instance.Name = (!string.IsNullOrEmpty(nameAttr))
                ? nameAttr
                : viElement.Name;
        }
        private void SetClickableElementData(FieldInfo viElement, ref VIElement instance)
        {
            var clickableElement = instance as IClickable;

            if (clickableElement == null)
            {
                return;
            }
            var clickLoadsPageAttr = ClickLoadsPageAttribute.Handler(viElement);

            clickableElement.ClickLoadsPage = clickLoadsPageAttr;
        }
        private void SetHaveValueData(FieldInfo viElement, ref VIElement instance)
        {
            var haveValueElement = instance as IHaveValue;

            if (haveValueElement == null)
            {
                return;
            }
            var fillFromNameAttr = FillFromFieldAttribute.GetFieldName(viElement);

            if (!string.IsNullOrEmpty(fillFromNameAttr))
            {
                haveValueElement.FillRule = data => data.GetFieldByName(fillFromNameAttr);
            }
        }
        private void CreateContext(FieldInfo viElement, ref VIElement instance)
        {
            instance.Context.Add(Context);

            var frameAttr = FrameAttribute.GetFrame(viElement);

            if (frameAttr != null)
            {
                instance.Context.Add(ContextType.Frame, frameAttr);
            }

            var locatorAttr = LocatorAttribute.GetLocator(viElement)
                              ?? LocatorAttribute.GetLocatorFomFindsBy(viElement);

            if (locatorAttr != null)
            {
                instance.Locator = locatorAttr;
            }
            if (_locator != null)
            {
                instance.Context.Add((this is Frame) ? ContextType.Frame : ContextType.Locator, _locator);
            }
        }
Exemplo n.º 5
0
 public Checkbox(IWebElement webElement) : base(webElement)
 {
     CheckSignElement = new VIElement(webElement);
 }
Exemplo n.º 6
0
 public Checkbox(string name, IWebElement webElement) : base(name, webElement)
 {
     CheckSignElement = new VIElement(name + " label", webElement);
 }
Exemplo n.º 7
0
 public Checkbox(By bySelector) : base(bySelector)
 {
     CheckSignElement = new VIElement("", bySelector);
 }
Exemplo n.º 8
0
 public Checkbox(string name, string cssSelector) : base(cssSelector, name)
 {
     CheckSignElement = new VIElement(name + " label", cssSelector);
 }
Exemplo n.º 9
0
 public Checkbox(string name, By bySelector) : base(name, bySelector)
 {
     CheckSignElement = new VIElement(name + " label", bySelector);
 }