Package daveayan.gherkinsalad.components.core

Examples of daveayan.gherkinsalad.components.core.Elements


    }
  }

  public Strings get_all_options() {
    Strings option_strings = Strings.new_instance();
    Elements options = root_element().findElements(By.tagName("option"));
    option_strings = Strings.instance_from(options.asString());
    return option_strings;
  }
View Full Code Here


    option_strings = Strings.instance_from(options.asString());
    return option_strings;
  }

  public String get_selected_option_text() {
    Elements options = root_element().findElements(By.tagName("option"));
    Element selected_option = options.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String selected = input.getAttribute("selected");
        if(StringUtils.isNotBlank(selected)) {
          return selected.equals("selected") || selected.equals("true");
        }
View Full Code Here

  }
 
  public void select_option_if_enabled(String option) {
    Element element = root_element();
    if (this.isEnabled()) {
      Elements options = element.findElements(By.tagName("option"));
      Element option_to_select = options.findFirstElementWithText(option);
      option_to_select.click();
    }
  }
View Full Code Here

  }

  public void select_code_if_enabled(String code) {
    Element element = root_element();
    if (this.isEnabled()) {
      Elements options = element.findElements(By.tagName("option"));
      for (Element o : options._nativeList()) {
        if (StringUtils.equals(o.getAttribute("value"), code)) {
          o.click();
          break;
        }
      }
View Full Code Here

    }
  }

  public Strings get_all_options() {
    Strings option_strings = Strings.new_instance();
    Elements options = root_element().findElements(By.tagName("option"));
    option_strings = Strings.instance_from(options.asString());
    return option_strings;
  }
View Full Code Here

    option_strings = Strings.instance_from(options.asString());
    return option_strings;
  }
 
  public Strings get_selected_options() {
    Elements options = root_element().findElements(By.tagName("option"));
    Elements selected_options = options.findElementsThatMatch(new Predicate<Element>() {
      public boolean apply(Element input) {
        String selected = input.getAttribute("selected");
        if(StringUtils.isNotBlank(selected)) {
          return selected.equals("selected") || selected.equals("true");
        }
        return false;
      }
    });
    return selected_options.toStrings();
  }
View Full Code Here

  private boolean tab_is_selected(Element tab) {
    return tab.getAttribute("aria-selected").contains("true");
  }
 
  private Element find_tab_li(final String tab_name) {
    Elements tabs = root_element().findElements(By.tagName("li"));
    Element tab = tabs.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element arg0) {
        return arg0.is(tab_name);
      }
    });
    return tab;
View Full Code Here

  public Strings get_all_options() {
    List<String> options = ListUtils.EMPTY_LIST;
    if(isEnabled()) {
      click_if_enabled();
      Element ul = find_ul_element();
      Elements li_a_s = ul.findElements(By.tagName("a"));
      options = li_a_s.asString();
      click_if_enabled();
    }
    return Strings.instance_from(options);
  }
View Full Code Here

  public String get_selected_option_text() {
    String option = StringUtils.EMPTY;
    if(isEnabled()) {
      click_if_enabled();
      Element ul = find_ul_element();
      Elements li_s = ul.findElements(By.tagName("a"));
     
      Element selected_element = li_s.findFirstElementThatMatches(new Predicate<Element>() {
        public boolean apply(Element li_a) {
          String value = li_a.getAttribute("aria-selected");
          if(StringUtils.isBlank(value)) {
            return false;
          }
View Full Code Here

  public Strings get_all_options() {
    List<String> options = ListUtils.EMPTY_LIST;
    if(isEnabled()) {
      click_if_enabled();
      Element ul = find_ul_element();
      Elements li_a_s = ul.findElements(By.tagName("a"));
      options = li_a_s.asString();
      click_if_enabled();
    }
    return Strings.instance_from(options);
  }
View Full Code Here

TOP

Related Classes of daveayan.gherkinsalad.components.core.Elements

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.