Package org.apache.wicket.util.tester

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


    }

    @Test
    public void titleIsSet() {
        tester().startComponentInPage(newTooltip("text"));
        final TagTester tag = tester().getTagByWicketId(id());

        assertThat(tag.getAttribute("title"), is(equalTo("text")));
    }
View Full Code Here


    }
   
    @Test
    public void labelIsLocalized() {
        tester().startComponentInPage(new MyContainer(id()).add(new TooltipBehavior(new ResourceModel("label"))));
        final TagTester tag = tester().getTagByWicketId(id());
        assertThat(tag.getAttribute("title"), is(equalTo("bar")));
    }
View Full Code Here

                super.onComponentTag(tag);
            }
        };

        tester().startComponentInPage(breadcrumb);
        final TagTester tester = tester().getTagByWicketId("breadcrumb");

        Attributes.assertClassNamesPresent(tester, "breadcrumb");
    }
View Full Code Here

            public Component newBodyComponent(String markupId) {
                return new Label(markupId, "content");
            }
        });

        TagTester tag = tester().getTagByWicketId(id());
        assertThat(tag.getAttribute("data-content"), is(equalTo("<wicket:container wicket:id=\"compId\">content</wicket:container>")));
    }
View Full Code Here

            public Component newBodyComponent(String markupId) {
                return new UploadProgressBar(markupId, new Form("dummy"), Model.of(50));
            }
        });

        TagTester tag = tester().getTagByWicketId(id());
        assertThat(tag.getAttribute("data-content"), startsWith("<wicket:div wicket:id=\"compId\" class=\"progress\"><wicket:panel>"));
        assertThat(tag.getAttribute("data-content"), endsWith("</wicket:panel></wicket:div>"));
        assertThat(tag.getAttribute("data-content"), containsString("<div wicket:id=\"bar\" class=\"progress-bar\" style=\"width: 50%\""));
    }
View Full Code Here

    @Test
    public void defaultSpanWidthIs12() {
        startBehaviorInPage(new SpanBehavior());

        TagTester tagTester = tester().getTagByWicketId(id());
        assertCssClass(tagTester, "col-lg-12");
        assertNotContainsCssClass(tagTester, "offset0");
    }
View Full Code Here

    @Test
    public void offset0DoesntNeedAClassName() {
        startBehaviorInPage(new SpanBehavior(LargeScreenSpanType.SPAN1, ExtraSmallOffsetType.OFFSET0));

        TagTester tagTester = tester().getTagByWicketId(id());
        assertNotContainsCssClass(tagTester, "offset0");
    }
View Full Code Here

    @Test
    public void spanWidthCanBeChanged() {
        for (int i = 1; i <= 12; i++) {
            startBehaviorInPage(new SpanBehavior(LargeScreenSpanType.valueOf("SPAN" + i)));

            TagTester tagTester = tester().getTagByWicketId(id());
            assertCssClass(tagTester, "col-lg-" + i);
        }
    }
View Full Code Here

    @Test
    public void offsetCanBeChanged() {
        for (int i = 1; i <= 12; i++) {
            startBehaviorInPage(new SpanBehavior(LargeScreenSpanType.SPAN1, ExtraSmallOffsetType.valueOf("OFFSET" + i)));

            TagTester tagTester = tester().getTagByWicketId(id());
            assertCssClass(tagTester, "col-xs-offset-" + i);
        }
    }
View Full Code Here

    @Test
    public void cssClassNameIsSet() {
        startBehaviorInPage(new RowBehavior());

        TagTester tagTester = tester().getTagByWicketId(id());
        assertCssClass(tagTester, "row");
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.tester.TagTester

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.