Package daveayan.gherkinsalad.components

Examples of daveayan.gherkinsalad.components.Element


    }
    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.getCssValue("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

    super.name(name);
    return this;
  }
 
  public boolean isEnabled() {
    Element element = root_element();
    return element.isEnabled();
  }
View Full Code Here

    Element element = root_element();
    return element.isEnabled();
  }

  public void click_if_enabled() {
    Element element = root_element();
    if(this.isEnabled()) {
      element.click();
    }
  }
View Full Code Here

    super.name(name);
    return this;
  }
 
  public boolean isEnabled() {
    Element element = root_element();
    return element.isEnabled();
  }
View Full Code Here

    Element element = root_element();
    return element.isEnabled();
  }

  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

      option_to_select.click();
    }
  }
 
  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

    super.name(name);
    return this;
  }

  public void click_if_enabled() {
    Element element = root_element();
    if(this.isEnabled()) {
      element.click();
    }
  }
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.