Package daveayan.gherkinsalad

Examples of daveayan.gherkinsalad.Strings


    report(formatted_html("info", info));
  }
 
  protected void code_trace() {
    StackTraceElement[] trace_element = Thread.currentThread().getStackTrace();
    Strings traces = Strings.new_instance();
    if(trace_element != null) {
      for(StackTraceElement element: trace_element) {
        traces.add(element.toString());
      }
    }
    report(formatted_html("action error", traces.toString()));
  }
View Full Code Here


  public String toString() {
    return toStrings().toString();
  }
 
  public Strings toStrings() {
    Strings strings = Strings.new_instance();
    for(Element element: _nativeList()) {
      strings = strings.add(element.getText());
    }
    return strings;
  }
View Full Code Here

      }
    }
  }

  public void should_have_options(String... expected_strings) {
    Strings options = Strings.instance_from(get_all_options());
    Strings strings_not_present = options
        .should_have_all_these_strings(expected_strings);
    strings_not_present.should_be_empty();
  }
View Full Code Here

        return input.getAttribute("value");
      }});
  }
 
  public void should_have_all_these(String... expected_options) {
    Strings option_strings = get_all_options();
    Strings strings_not_present = option_strings.has_all_these(expected_options);
    if(strings_not_present.is_empty()) {
      action("Verified dropdown " + this + " has all these options " + Strings.instance_from(expected_options).toString());
    } else {
      error("Expected dropdown " + this + " to have all these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_not_present);
    }
  }
View Full Code Here

      error("Expected dropdown " + this + " to have all these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_not_present);
    }
  }

  public void should_have_any_of_these(String... expected_options) {
    Strings option_strings = get_all_options();
    Strings strings_present = option_strings.has_any_of_these(expected_options);
    if(strings_present.is_not_empty()) {
      action("Verified dropdown " + this + " has these options " + Strings.instance_from(expected_options).toString());
    } else {
      error("Expected dropdown " + this + " to have any of these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_present);
    }
  }
View Full Code Here

      error("Expected dropdown " + this + " to have any of these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_present);
    }
  }

  public void should_not_have_any_of_these(String... expected_options) {
    Strings option_strings = get_all_options();
    Strings strings_present = option_strings.has_any_of_these(expected_options);
    if(strings_present.is_empty()) {
      action("Verified dropdown " + this + " has none of these options " + Strings.instance_from(expected_options).toString());
    } else {
      error("Expected dropdown " + this + " to have none of these options " + Strings.instance_from(expected_options).toString() + " found these " + strings_present);
    }
  }
View Full Code Here

      error("Expected dropdown " + this + " to have none of these options " + Strings.instance_from(expected_options).toString() + " found these " + strings_present);
    }
  }

  public void should_have_these_options_selected(String... options) {
    Strings selected_options = get_selected_options();
    Strings selected_options_not_found = Strings.new_instance();
    for(String option: options) {
      if(selected_options.does_not_have(option)) {
        selected_options_not_found.add(option);
      }
    }
   
    if(selected_options_not_found.is_empty()) {
      action("Verified that the selected options in " + this + " are " + Strings.instance_from(options).toString());
    } else {
      error("Expected dropdown " + this + " to have selected options " + Strings.instance_from(options).toString() +", did not find these selected " + selected_options_not_found);
    }
  }
View Full Code Here

      error("Expected dropdown " + this + " to have selected options " + Strings.instance_from(options).toString() +", did not find these selected " + selected_options_not_found);
    }
  }

  public void should_not_have_these_options_selected(String... options) {
    Strings selected_options = get_selected_options();
    Strings selected_options_found = Strings.new_instance();
    for(String option: options) {
      if(selected_options.has(option)) {
        selected_options_found.add(option);
      }
    }
   
    if(selected_options_found.is_empty()) {
      action("Verified that the selected options in " + this + " are NOT " + Strings.instance_from(options).toString());
    } else {
      error("Expected dropdown " + this + " to NOT have selected options " + Strings.instance_from(options).toString() +", found these selected " + selected_options_found);
    }
  }
View Full Code Here

    });
    element_to_select.click();
  }

  public void should_have_all_these(String... expected_options) {
    Strings option_strings = get_all_options();
    Strings strings_not_present = option_strings.has_all_these(expected_options);
    if(strings_not_present.is_empty()) {
      action("Verified dropdown " + this + " has all these options " + Strings.instance_from(expected_options).toString());
    } else {
      error("Expected dropdown " + this + " to have all these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_not_present);
    }
  }
View Full Code Here

      error("Expected dropdown " + this + " to have all these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_not_present);
    }
  }
 
  public void should_have_any_of_these(String... expected_options) {
    Strings option_strings = get_all_options();
    Strings strings_present = option_strings.has_any_of_these(expected_options);
    if(strings_present.is_not_empty()) {
      action("Verified dropdown " + this + " has these options " + Strings.instance_from(expected_options).toString());
    } else {
      error("Expected dropdown " + this + " to have any of these options " + Strings.instance_from(expected_options).toString() + " did not find these " + strings_present);
    }
  }
View Full Code Here

TOP

Related Classes of daveayan.gherkinsalad.Strings

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.