Example #1
0
File: CheckBox.cs Project: epam/JDI
 protected void UncheckAction(WebBaseElement el)
 {
     if (IsCheckedAction((CheckBox)el))
         ClickAction(el);
     if (IsCheckedAction((CheckBox)el))
         throw Exception("Can't uncheck element. Verify locator for click or isCheckedAction");
 }
Example #2
0
 public GetElementModule(WebBaseElement element, By byLocator = null)
 {
     Element   = element;
     ByLocator = byLocator;
     if (IsNullOrEmpty(DriverName) && WebSettings.WebDriverFactory != null && !IsNullOrEmpty(WebSettings.WebDriverFactory.CurrentDriverName))
     {
         DriverName = WebSettings.WebDriverFactory.CurrentDriverName;
     }
 }
Example #3
0
        private ISearchContext SearchContext(WebBaseElement element)
        {
            var searchContext = element.Parent is WebBaseElement
                ? SearchContext((WebBaseElement)element.Parent)
                : WebDriver.SwitchTo().DefaultContent();

            return(element.Locator != null
                ? searchContext.FindElement(CorrectXPath(element.Locator))
                : searchContext);
        }
Example #4
0
 protected void UncheckAction(WebBaseElement el)
 {
     if (IsCheckedAction((CheckBox)el))
     {
         ClickAction(el);
     }
     if (IsCheckedAction((CheckBox)el))
     {
         throw Exception("Can't uncheck element. Verify locator for click or isCheckedAction");
     }
 }
Example #5
0
 protected void SetValueAction(WebBaseElement el, string value)
 {
     switch (value.ToLower())
     {
         case "true":
         case "1":
         case "check":
             ((CheckBox)el).Check();
             break;
         case "false":
         case "0":
         case "uncheck":
             ((CheckBox)el).Uncheck();
             break;
         default:
             throw Exception($"SetValue not specified correctly {value}, expected: 'true','false','0','1','check','uncheck'");
     }
 }
Example #6
0
        protected void SetValueAction(WebBaseElement el, string value)
        {
            switch (value.ToLower())
            {
            case "true":
            case "1":
            case "check":
                ((CheckBox)el).Check();
                break;

            case "false":
            case "0":
            case "uncheck":
                ((CheckBox)el).Uncheck();
                break;

            default:
                throw Exception($"SetValue not specified correctly {value}, expected: 'true','false','0','1','check','uncheck'");
            }
        }
Example #7
0
 public CheckBox(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element: element)
 {
 }
Example #8
0
 protected BaseSelector(By optionsNamesLocator, By allLabelsLocator, List <IWebElement> webElements = null, WebBaseElement element = null)
     : base(optionsNamesLocator, webElements: webElements, element: element)
 {
     _allLabels = new GetElementType(allLabelsLocator, this);
 }
Example #9
0
 public GetElementModule(WebBaseElement element, By byLocator = null)
 {
     Element   = element;
     ByLocator = byLocator;
 }
Example #10
0
 public TextField(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element: element)
 {
 }
Example #11
0
 public ActionInvoker(WebBaseElement element)
 {
     JDISettings.NewTest();
     _element = element;
 }
Example #12
0
 protected bool IsCheckedAction(WebBaseElement el)
 {
     return ((CheckBox)el).IsCheckedFunc(el);
 }
Example #13
0
 public Clickable(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element)
 {
 }
Example #14
0
 private static void SetUpDropdownFromAnnotation(WebBaseElement instance, FieldInfo field)
 {
     var jMenu = field.GetAttribute<JMenuAttribute>();
     if (jMenu == null || !typeof(IMenu).IsAssignableFrom(field.FieldType))
         return;
     SetUpMenu((Menu)instance, jMenu);
 }
Example #15
0
 public Clickable(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null) 
     : base(byLocator, webElement, element) { }
Example #16
0
 public Selector(By optionsNamesLocatorTemplate, By allOptionsNamesLocator, List <IWebElement> webElements = null, WebBaseElement element = null)
     : base(optionsNamesLocatorTemplate, allOptionsNamesLocator, webElements, element)
 {
 }
 public GetElementClass(WebBaseElement element)
 {
     _element = element;
 }
Example #18
0
 public SelectableElement(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element: element)
 {
 }
Example #19
0
 public ElementsActions(WebBaseElement element)
 {
     _element = element;
 }
Example #20
0
 private static void SetUpTableFromAnnotation(WebBaseElement instance, FieldInfo field)
 {
     var jTable = field.GetAttribute<JTableAttribute>();
     if (jTable == null || !typeof(ITable).IsAssignableFrom(field.FieldType))
         return;
     SetUpTable((Table)instance, jTable);
 }
Example #21
0
 public FileInput(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element: element)
 {
 }
Example #22
0
 private static void SetUpMenuFromAnnotation(WebBaseElement instance, FieldInfo field)
 {
     var jDropdown = field.GetAttribute<JDropdownAttribute>();
     if (jDropdown == null || !typeof(IDropDown).IsAssignableFrom(field.FieldType))
         return;
     SetUpDropdown((Dropdown)instance, jDropdown);
 }
Example #23
0
 public GetElementModule(WebBaseElement element, Pairs <ContextType, By> context = null)
 {
     _element   = element;
     DriverName = JDISettings.DriverFactory.CurrentDriverName;
     Context    = context ?? new Pairs <ContextType, By>();
 }
Example #24
0
 public Button(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element:element) { }
Example #25
0
 protected bool IsCheckedAction(WebBaseElement el)
 {
     return(((CheckBox)el).IsCheckedFunc(el));
 }
Example #26
0
File: Text.cs Project: epam/JDI
 public Text(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element:element) { }
Example #27
0
 public DatePicker(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element: element)
 {
 }
Example #28
0
 public ActionScenarios SetElement(WebBaseElement element)
 {
     _element = element;
     return(this);
 }
 public ElementsActions(WebBaseElement element)
 {
     _element = element;
 }
Example #30
0
 public GetElementModule(WebBaseElement element, By byLocator = null)
 {
     Element    = element;
     DriverName = JDISettings.DriverFactory.CurrentDriverName;
     ByLocator  = byLocator;
 }
Example #31
0
 public GetElement(WebBaseElement element)
 {
     this._element = element;
 }
Example #32
0
 public GetElementClass(WebBaseElement element)
 {
     _element = element;
 }
Example #33
0
 private static void FillFromAnnotation(WebBaseElement instance, FieldInfo field)
 {
     SetUpTableFromAnnotation(instance, field);
     SetUpMenuFromAnnotation(instance, field);
     SetUpDropdownFromAnnotation(instance, field);
 }
Example #34
0
 public DatePicker(By byLocator = null, IWebElement webElement = null, WebBaseElement element = null)
     : base(byLocator, webElement, element:element) { }
Example #35
0
 protected BaseSelector(By optionsNamesLocator, List <IWebElement> webElements = null, WebBaseElement element = null) :
     base(optionsNamesLocator, webElements: webElements, element: element)
 {
 }