Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlElement


    }

    @Test
    public final void testEncodeHeader() throws IOException {
        HtmlPage page = environment.getPage("/dataGridTest.jsf");
        HtmlElement dataGrid = (HtmlElement) page.getElementById("dataGrid");
        HtmlElement th = dataGrid.getFirstByXPath("thead[@class='rf-dg-thead']/tr[@class='rf-dg-h']/th[@class='rf-dg-h-c']");
        assertEquals("1", th.getAttribute("colspan"));
        assertEquals("headerFacet", page.getElementById("dataGrid:headerFacet").getTextContent());
    }
View Full Code Here


    }

    @Test
    public final void testEncodeFooter() throws IOException {
        HtmlPage page = environment.getPage("/dataGridTest.jsf");
        HtmlElement dataGrid = (HtmlElement) page.getElementById("dataGrid");
        HtmlElement td = dataGrid.getFirstByXPath("tfoot[@class='rf-dg-tfoot']/tr[@class='rf-dg-f']/td[@class='rf-dg-f-c']");
        assertEquals("1", td.getAttribute("colspan"));
        assertEquals("footerFacet", page.getElementById("dataGrid:footerFacet").getTextContent());
    }
View Full Code Here

    }

    @Test
    public final void testEncodeCaption() throws IOException {
        HtmlPage page = environment.getPage("/dataGridTest.jsf");
        HtmlElement dataGridCaption = (HtmlElement) page.getElementById("dataGrid:captionFacet");
        assertEquals("captionFacet", dataGridCaption.getTextContent());
    }
View Full Code Here

    }

    @Test
    public final void testEncodeTBody() throws IOException {
        HtmlPage page = environment.getPage("/dataGridTest.jsf");
        HtmlElement dataGrid = (HtmlElement) page.getElementById("dataGrid2");
        assertEquals("rf-dg-body", ((HtmlElement) dataGrid.getFirstByXPath("tbody[@id='dataGrid2:dgb']")).getAttribute("class"));
    }
View Full Code Here

    public void testOrderedList() throws Exception {
        HtmlPage page = environment.getPage("/test.jsf");
        List<?> nodes = page.getByXPath("//*[@id = 'form:ol']");

        assertEquals(1, nodes.size());
        HtmlElement list = (HtmlElement) nodes.get(0);
        assertEquals("ol", list.getNodeName());
        assertEquals("rf-olst", list.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
        verifySimpleListItems(list, "rf-olst-itm");
    }
View Full Code Here

    public void testUnorderedList() throws Exception {
        HtmlPage page = environment.getPage("/test.jsf");
        List<?> nodes = page.getByXPath("//*[@id = 'form:ul']");

        assertEquals(1, nodes.size());
        HtmlElement list = (HtmlElement) nodes.get(0);

        assertEquals("ul", list.getNodeName());
        assertEquals("rf-ulst", list.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
        verifySimpleListItems((HtmlElement) list, "rf-ulst-itm");
    }
View Full Code Here

    public void testDefinitionsList() throws Exception {
        HtmlPage page = environment.getPage("/test.jsf");
        List<?> nodes = page.getByXPath("//*[@id = 'form:dl']");

        assertEquals(1, nodes.size());
        HtmlElement list = (HtmlElement) nodes.get(0);
        assertEquals("dl", list.getNodeName());
        verifyDefinitionsListItems(list);
    }
View Full Code Here

    public void testFakeItem() throws Exception {
        HtmlPage page = environment.getPage("/test.jsf");
        List<?> nodes = page.getByXPath("//*[@id = 'form:emptyList']");

        assertEquals(1, nodes.size());
        HtmlElement list = (HtmlElement) nodes.get(0);
        assertEquals("ol", list.getNodeName());

        HtmlElement fakeItem = (HtmlElement) list.getFirstByXPath("li");
        assertNotNull(fakeItem);
        assertEquals("display:none", fakeItem.getAttribute("style"));
    }
View Full Code Here

        List<?> listItems = listElement.getByXPath("li");
        assertEquals(testBean.getList().size(), listItems.size());
        for (int i = 0; i < listItems.size(); i++) {
            Data data = testBean.getList().get(i);

            HtmlElement item = (HtmlElement) listItems.get(i);

            assertEquals("li", item.getNodeName());
            assertEquals(styleClass, item.getAttribute("class"));
            assertEquals(data.getTerm(), item.asText());
        }
    }
View Full Code Here

        assertEquals(testBean.getList().size(), definitionItems.size());

        for (int i = 0; i < termItems.size(); i++) {
            Data data = testBean.getList().get(i);

            HtmlElement item = (HtmlElement) termItems.get(i);
            assertEquals("dt", item.getNodeName());
            assertEquals("rf-dlst-trm", item.getAttribute("class"));
            assertEquals(data.getTerm(), item.asText());
        }

        for (int i = 0; i < definitionItems.size(); i++) {
            Data data = testBean.getList().get(i);

            HtmlElement item = (HtmlElement) definitionItems.get(i);
            assertEquals("dd", item.getNodeName());
            assertEquals("rf-dlst-dfn", item.getAttribute("class"));
            assertEquals(data.getDefinition(), item.asText());
        }
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlElement

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.