Package daveayan.gherkinsalad.components

Examples of daveayan.gherkinsalad.components.Element


      action("Did not click '" + this + "' since it is not enabled and not displayed");
    }
  }

  public void enter_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isEnabled()) {
      wait_between_steps();
      element.clear();
      element.sendKeys(text);
      action("Entered text '" + text + "' in " + this);
    } else {
      action("Did not enter text in element '" + this + "' since it is not enabled");
    }
  }
View Full Code Here


      action("Did not enter text in element '" + this + "' since it is not enabled");
    }
  }

  public void append_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isEnabled()) {
      wait_between_steps();
      String current_text = element.getAttribute("value");
      element.clear();
      element.sendKeys(text + current_text);
      action("Appended text '" + text + "' in " + this);
    } else {
      action("Did not append text in element '" + this + "' since it is not enabled");
    }
  }
View Full Code Here

    t.found(root);
    return t;
  }
 
  public void select_tab(final String tab_name) {
    Element tab = find_tab_li(tab_name);
    if(tab_is_selected(tab)) {
      info("Tab '" + tab_name + "' is already selected.");
    } else {
      action("Selecting tab '" + tab_name + "', element '" + tab +"'");
      tab.findElement(By.tagName("a")).click();
    }
    takeScreenshot();
  }
View Full Code Here

    }
    takeScreenshot();
  }

  public void selected_tab_should_be(String expected_selected_tab) {
    Element tab = find_tab_li(expected_selected_tab);
    if(tab_is_selected(tab)) {
      action("Verified that tab '" + expected_selected_tab +"' is selected");
    } else {
      error("Expected tab '" + expected_selected_tab + "' to be selected, it is not");
    }
View Full Code Here

    }
    takeScreenshot();
  }
 
  public void selected_tab_should_not_be(String expected_selected_tab) {
    Element tab = find_tab_li(expected_selected_tab);
    if(! tab_is_selected(tab)) {
      action("Verified that tab '" + expected_selected_tab +"' is not selected");
    } else {
      error("Expected tab '" + expected_selected_tab + "' to be not selected, it is");
    }
View Full Code Here

    }
    takeScreenshot();
  }
 
  public void remove_tab(String tab_to_remove) {
    Element tab = find_tab_li(tab_to_remove);
    Element tab_close_icon = tab.findElement(By.className("ui-icon-close"));
    if(tab_close_icon.is_null()) {
      error("Tab '" + tab_to_remove +"' does not have the icon to close it. Cannot remove");
    } else {
      tab_close_icon.click();
      action("Tab '" + tab_to_remove + "' removed.");
    }
    takeScreenshot();
  }
View Full Code Here

    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

    takeScreenshot();
  }
 
  private String get_month_in_picker() {
    while(true) {
      Element cal_month = root_element().findElement(By.className("ui-datepicker-month")).name("Date Picker - Month");
      String cal_month_text = cal_month.getText();
      if(StringUtils.isNotEmpty(cal_month_text)) {
        return cal_month_text;
      }
    }
  }
View Full Code Here

    }
  }
 
  private String get_year_in_picker() {
    while(true) {
      Element cal_year = root_element().findElement(By.className("ui-datepicker-year")).name("Date Picker - Year");
      String cal_year_text = cal_year.getText();
      if(StringUtils.isNotEmpty(cal_year_text)) {
        return cal_year_text;
      }
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<String> 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 options;
  }
View Full Code Here

TOP

Related Classes of daveayan.gherkinsalad.components.Element

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.