Examples of TagTester


Examples of org.apache.wicket.util.tester.TagTester

    link.setMarkupId("link");
    link.setBody(Model.of(linkBody));
    mockPageWithLink.add(link);

    wicketTester.startPage(mockPageWithLink);
    TagTester tagTester = wicketTester.getTagById("link");
    Assert.assertEquals(linkBody, tagTester.getValue());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

  @Test
  public void wicket1382()
  {
    AjaxyImagesPage page = tester.startPage(AjaxyImagesPage.class);

    TagTester tagTester = tester.getTagById(page.image.getMarkupId());
    final String srcAttr = tagTester.getAttribute("src");
    assertFalse(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
      srcAttr.contains("wicket:antiCache"));

    // make an ajax call
    tester.clickLink("link", true);
    page = (AjaxyImagesPage)tester.getLastRenderedPage();
    tagTester = tester.getTagById(page.image.getMarkupId());
    final String imageAjaxComponent = tagTester.getValue();
    assertTrue(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
      imageAjaxComponent.contains("wicket:antiCache"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

   */
  public void testAnchorGetsHrefReplaced()
  {
    tester.startPage(AjaxLinkPage.class);

    TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");

    // It was a link to google in the markup, but should be replaced to "#"
    assertTrue(ajaxLink.getAttributeIs("href", "#"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

   */
  public void testJavascriptEndsWithReturn()
  {
    tester.startPage(AjaxLinkPage.class);

    TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");

    assertTrue(ajaxLink.getAttributeEndsWith("onclick", "return !wcall;"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

   */
  public void testJavascriptEndsWithReturn()
  {
    tester.startPage(AjaxLinkPage.class);

    TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");

    assertTrue(ajaxLink.getAttributeEndsWith("onclick", "return !wcall;"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

   */
  public void testAnchorGetsHrefReplaced()
  {
    tester.startPage(AjaxLinkPage.class);

    TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");

    // It was a link to google in the markup, but should be replaced to "#"
    assertTrue(ajaxLink.getAttributeIs("href", "#"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

    link.setMarkupId("link");
    link.setBody(Model.of(linkBody));
    mockPageWithLink.add(link);

    wicketTester.startPage(mockPageWithLink);
    TagTester tagTester = wicketTester.getTagById("link");
    Assert.assertEquals(linkBody, tagTester.getValue());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

  public void wicket1382()
  {
    WicketTester tester = new WicketTester();
    AjaxyImagesPage page = tester.startPage(AjaxyImagesPage.class);

    TagTester tagTester = tester.getTagById(page.image.getMarkupId());
    final String srcAttr = tagTester.getAttribute("src");
    assertFalse(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
      srcAttr.contains("wicket:antiCache"));

    // make an ajax call
    tester.clickLink("link", true);
    page = (AjaxyImagesPage)tester.getLastRenderedPage();
    tagTester = tester.getTagById(page.image.getMarkupId());
    final String imageAjaxComponent = tagTester.getValue();
    assertTrue(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
      imageAjaxComponent.contains("wicket:antiCache"));
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

        tester().startComponentInPage(
            form,
            Markup.of("<form wicket:id='form'><div wicket:id='id'><input type='text' wicket:id='value'/></div></form>"));

        TagTester formGroupTester = tester().getTagByWicketId("id");
        assertThat(formGroupTester.getAttribute("class"), containsString("form-group"));

        FormTester formTester = tester().newFormTester("form", false);
        formTester.setValue(input, "Hello World!");

        updateModelCounter.set(0);
View Full Code Here

Examples of org.apache.wicket.util.tester.TagTester

        group.add(input);

        tester().startComponentInPage(
                form,
                Markup.of("<form wicket:id='form'><div wicket:id='formGroup'><input type='text' wicket:id='value'/></div></form>"));
        TagTester formGroupTester = tester().getTagByWicketId("formGroup");
        assertThat(formGroupTester.getAttribute("class"), containsString("form-group-lg"));
    }
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.