Exemplo n.º 1
0
 public WebBaseElement(By byLocator = null, IWebElement webElement = null,
                       List <IWebElement> webElements = null)
 {
     Invoker         = new ActionInvoker(this);
     GetElementClass = new GetElementClass(this);
     Actions         = new ElementsActions(this);
     WebAvatar       = new GetElementModule(this, byLocator)
     {
         WebElement = webElement, WebElements = webElements
     };
 }
Exemplo n.º 2
0
 public WebBaseElement(By byLocator = null, IWebElement webElement = null)
 {
     Invoker         = new ActionInvoker(this);
     GetElementClass = new GetElementClass(this);
     Actions         = new ElementsActions(this);
     _webElement     = webElement;
     Avatar          = new GetElementModule
     {
         Element   = this,
         ByLocator = byLocator
     };
 }
Exemplo n.º 3
0
 public void Fill(Dictionary <string, string> map)
 {
     this.GetFields(typeof(ISetValue)).ForEach(element =>
     {
         var fieldValue = map.FirstOrDefault(pair =>
                                             GetElementClass.NamesEqual(pair.Key, NameAttribute.GetElementName(element))).Value;
         if (fieldValue == null)
         {
             return;
         }
         var setValueElement = (ISetValue)element.GetValue(this);
         DoActionRule(fieldValue, val => SetFieldValueAction(this, val, setValueElement));
     });
 }
Exemplo n.º 4
0
 public WebBaseElement(By byLocator = null, IWebElement webElement = null,
                       List <IWebElement> webElements = null, WebBaseElement element = null)
 {
     Invoker         = new ActionInvoker(this);
     GetElementClass = new GetElementClass(this);
     Actions         = new ElementsActions(this);
     WebAvatar       = new GetElementModule(this, byLocator)
     {
         WebElement = webElement, WebElements = webElements
     };
     if (element != null)
     {
         WebAvatar.DriverName = element.WebAvatar.DriverName;
         Parent = element.Parent;
     }
 }
Exemplo n.º 5
0
        public IList <string> Verify(Dictionary <string, string> objStrings)
        {
            var compareFalse = new List <string>();

            this.GetFields(typeof(IHasValue)).ForEach(field => {
                var fieldValue = objStrings.FirstOrDefault(pair =>
                                                           GetElementClass.NamesEqual(pair.Key, NameAttribute.GetElementName(field))).Value;
                if (fieldValue == null)
                {
                    return;
                }
                var valueField = (IHasValue)field.GetValue(this);
                DoActionRule(fieldValue, expected => {
                    var actual = GetFieldValueAction(this, valueField).Trim();
                    if (actual.Equals(expected))
                    {
                        return;
                    }
                    compareFalse.Add($"Field '{field.Name}' (Actual: '{actual}' <> Expected: '{expected}')");
                });
            });
            return(compareFalse);
        }
Exemplo n.º 6
0
 public Popup()
 {
     GetTextAction = p => GetElementClass.GetTextElement().Text;
 }
Exemplo n.º 7
0
 public void Close()
 {
     GetElementClass.GetButton(Functions.Close).Click();
 }
Exemplo n.º 8
0
 public void Cancel()
 {
     GetElementClass.GetButton(Functions.Cancel).Click();
 }
Exemplo n.º 9
0
 public void Ok()
 {
     GetElementClass.GetButton(Functions.Ok).Click();
 }
Exemplo n.º 10
0
 public void Submit(string text, string buttonName)
 {
     SetText(text);
     GetElementClass.GetButton(buttonName).Click();
 }
Exemplo n.º 11
0
 public void Submit(string text)
 {
     SetText(text);
     GetElementClass.GetButton("Submit").Click();
 }
Exemplo n.º 12
0
 public void Submit(Dictionary <string, string> objStrings)
 {
     Fill(objStrings);
     GetElementClass.GetButton("Submit").Click();
 }
Exemplo n.º 13
0
 public void Submit(T entity, string buttonName)
 {
     Fill(entity.ToSetValue());
     GetElementClass.GetButton(buttonName).Click();
 }
Exemplo n.º 14
0
 public void Submit(T entity, Enum buttonName)
 {
     Fill(entity.ToSetValue());
     GetElementClass.GetButton(buttonName.ToString().ToLower()).Click();
 }