Package net.sourceforge.jwebunit.api

Examples of net.sourceforge.jwebunit.api.IElement


   */
  public IElement assertLabelTextPresent(String text, String notText) {
    assertFalse(text.equals(notText))// sanity check
    assertFalse("Cannot assert the presence of an empty label", text.isEmpty());
   
    IElement match = getElementByXPath("//label[" + getContainsTextXPath(text) + " and not(" + getContainsTextXPath(notText) + ")]");
    assertNotNull(match);
    String textContent = match.getTextContent();
    // normalise
    textContent = textContent.replaceAll("[\\s]+", " ").trim();
    assertEquals(text, textContent);
   
    return match;
View Full Code Here


     *
     * <p>{@inheritDoc}
     */
    @Override
  public void assertButtonPresentWithText(String text) {
      IElement button = getButtonWithText(text);
      // we found a button; check that it is visible
        assertTrue("Found button with text '" + text + "', but it was hidden", isDisplayed(button));
    }
View Full Code Here

     *
     * <p>{@inheritDoc}
     */
    @Override
  public void assertButtonNotPresentWithText(String text) {
      IElement button;
      try {
        button = getButtonWithText(text);
      } catch (AssertionFailedError e) {
        // expected
        return;
View Full Code Here

   *
   * @throws IOException
   */
  public void typeLabeledFormElement(String id, String text) throws IOException {
    // get the elements referenced by this label
    IElement label = getElementById(id);
    assertNotNull(label);
   
    List<IElement> elements = getFieldsForLabel(label);
    assertFalse("Could not find any elements for label " + id, elements.isEmpty());
   
View Full Code Here

   *
   * @param id
   */
  public void loseFocus(String id) {
    // get the elements referenced by this label
    IElement label = getElementById(id);
    assertNotNull(label);
   
    List<IElement> elements = getFieldsForLabel(label);
    assertFalse("Could not find any elements for label " + id, elements.isEmpty());
   
View Full Code Here

   * @throws Exception
   */
  public void testInitialState() throws Exception {
    beginAtSitemapThenPage("Home");
   
    IElement map = assertHasMap("target map");
   
    // but no map points are generated yet
    assertHasNoMapPoint("address 1");
    assertHasNoMapPoint(map, "address 1");

View Full Code Here

      assertLabeledFieldEquals(target, "");
      setLabeledFormElementField(target, "Wellington, New Zealand");
    }
   
    assertNoProblem();
    IElement map = assertHasMap("target map");
   
    // but no map points are generated yet
    assertHasNoMapPoint("address 1");
    assertHasNoMapPoint(map, "address 1");

    assertHasNoMapPoint("address 3");
    assertHasNoMapPoint(map, "address 3");
   
    // but we do have an address 2
    if (!doCheckPoints()) return;
    IElement point1 = assertHasMapPoint("address 2");
    IElement point2 = assertHasMapPoint(map, "address 2");
    assertEquals(point1, point2);

  }
View Full Code Here

      assertLabeledFieldEquals(target, "");
      setLabeledFormElementField(target, "Christchurch, New Zealand");
    }
   
    assertNoProblem();
    IElement map = assertHasMap("target map");
   
    if (!doCheckPoints()) return;
    {
      IElement point1 = assertHasMapPoint("address 1");
      IElement point2 = assertHasMapPoint(map, "address 1");
      assertEquals(point1, point2);
    }
    {
      IElement point1 = assertHasMapPoint("address 2");
      IElement point2 = assertHasMapPoint(map, "address 2");
      assertEquals(point1, point2);
    }
    {
      IElement point1 = assertHasMapPoint("address 3");
      IElement point2 = assertHasMapPoint(map, "address 3");
      assertEquals(point1, point2);
    }
  }
View Full Code Here

      String target = getLabelIDForInputText("address 1");
      setLabeledFormElementField(target, "Christchurch, New Zealand");
    }

    assertNoProblem();
    IElement map = assertHasMap("target map");
   
    if (!doCheckPoints()) return;
    {
      IElement point1 = assertHasMapPoint("address 1");
      IElement point2 = assertHasMapPoint(map, "address 1");
      assertEquals(point1, point2);
    }
    {
      IElement point1 = assertHasMapPoint("address 2");
      IElement point2 = assertHasMapPoint(map, "address 2");
      assertEquals(point1, point2);
    }
    {
      IElement point1 = assertHasMapPoint("address 3");
      IElement point2 = assertHasMapPoint(map, "address 3");
      assertEquals(point1, point2);
    }
  }
View Full Code Here

   */
  public void testHasMap() throws Exception {

    beginAtSitemapThenPage("Home");
   
    IElement map = assertHasMap("containing map");
   
    // point hasn't been set yet
    assertHasNoMapPoint(map, "target point");
    assertNoProblem();

View Full Code Here

TOP

Related Classes of net.sourceforge.jwebunit.api.IElement

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.