Examples of IElement


Examples of net.sourceforge.jwebunit.api.IElement

  /**
   * Assert a map with the given name does <em>not</em> exist.
   */
  public void assertHasNoMap(String label) {
    try {
      IElement map = assertHasMap(label);
      throw new RuntimeException("Unexpectedly found map with label '" + label + "': " + map);
    } catch (AssertionFailedError e) {
      // expected
    }
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

  public IElement assertHasMapPoint(IElement map, String label) {
    // find a label with the given string
    String id = getLabelIDForText(label, "NOT_MAP_TEXT", "contains(@class, 'point')");
   
    // this should contain a 'map' <div>
    IElement wrapper = getElementById(id);
    assertNotNull(wrapper);
   
    // through label.for
    assertNotNull(wrapper.getAttribute("for"));
    IElement point = getElementById(wrapper.getAttribute("for"));
    assertNotNull(point);
   
    // assert that the map point is visible
    assertTrue("Map point " + point + "should be displayed", isDisplayed(point));
   
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

  public IElement assertHasMapPoint(String label) {
    // find a label with the given string
    String id = getLabelIDForText(label, "NOT_MAP_TEXT", "contains(@class, 'point')");
   
    // this should contain a 'map' <div>
    IElement wrapper = getElementById(id);
    assertNotNull(wrapper);
   
    // through label.for
    assertNotNull(wrapper.getAttribute("for"));
    IElement point = getElementById(wrapper.getAttribute("for"));
    assertNotNull(point);
   
    // assert that the map point is visible
    assertTrue("Map point " + point + "should be displayed", isDisplayed(point));
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

  /**
   * Assert that the given map point does <em>not</em> exist anywhere.
   */
  public void assertHasNoMapPoint(String label) {
    try {
      IElement point = assertHasMapPoint(label);
      throw new RuntimeException("Unexpectedly found map point '" + label + "': " + point);
    } catch (AssertionFailedError e) {
      // expected
    }
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * @param map
   * @param string
   */
  public void assertHasNoMapPoint(IElement map, String string) {
    boolean failed = false;
    IElement point = null;
    try {
      point = assertHasMapPoint(map, string);
      failed = true;
    } catch (AssertionFailedError e) {
      // expected
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   *
   * @param linkName
   * @return
   */
  public String getURLOfLink(String linkName) {
    IElement link = getElementByXPath("//a[contains(text(), '" + linkName + "')]");
    assertNotNull(link);
   
    // find the href
    String href = link.getAttribute("href");
    assertNotNull(href);
    assertNotEquals(href, "");
   
    // TODO get the current page URL from JWebUnit in order to work out
    // the current relative path to the sitemap
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   
    // make sure the link exists, first
    assertLinkPresentWithExactText(pageText);
   
    // now find the link, and get where it goes to
    IElement element = getElementByXPath("//a[normalize-space(text()) = normalize-space('" + pageText + "')]");   
    String href = element.getAttribute("href");
    assertNotNull(href);
   
    // construct the url
    String url = getOutputRoot().getProjectRelativePath().toString()
       + "/"
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * @return
   */
  protected IElement getFieldForLabel(String labelText) {
    List<IElement> list = hasLabelForText(labelText);
    assertEquals(1, list.size());
    IElement label = list.get(0);
   
    List<IElement> forFields = getFieldsForLabel(label);
    assertEquals(1, forFields.size());
    return forFields.get(0);   
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * @return
   */
  protected String getLabelIDForText(String text) {
    List<IElement> elements = hasLabelForText(text);
    assertEquals("Too many labels found for text '" + text + "'", 1, elements.size());
    IElement element = elements.get(0);
    String id = element.getAttribute("id");
    assertNotNull("Label ID for text '" + text + "' was null", id);
    return id;
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * @param notText
   * @return
   */
  protected String getLabelIDForText(String text, String notText) {
    logTimed("web", "internal", "get label ID for text (2)");
    IElement element = getElementByXPath("//label[" + getContainsTextXPath(text) + " and not(" + getContainsTextXPath(notText) + ")]");
    logTimed("web", "internal", "get label ID for text (2) complete");
    return element.getAttribute("id");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.