* @throws IOException
*/
@Test
public final void testDoEncode() throws IOException {
HtmlPage page = environment.getPage("/panelTest.jsf");
HtmlElement panelWithFacet = page.getHtmlElementById("panelWithFacet");
assertEquals("rf-p panel", panelWithFacet.getAttribute("class"));
assertEquals("Write your own custom rich components with built-in AJAX support",
page.getElementById("panelWithFacet_header").getTextContent().trim());
assertEquals("The CDK includes", page.getElementById("panelWithFacet_body").getTextContent().trim()
.substring(0, 16));
HtmlElement simplePanel = page.getHtmlElementById("simplePanel");
assertEquals("rf-p ", simplePanel.getAttribute("class"));
try {
page.getElementById("simplePanel_header");
} catch (Exception e) {
assertTrue(true);
}
assertEquals("RichFaces is a l", page.getElementById("simplePanel_body").getTextContent().trim()
.substring(0, 16));
HtmlElement simplePanelBody = page.getHtmlElementById("simplePanel_body");
assertEquals("rf-p-b rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
HtmlElement simplePanel2 = page.getHtmlElementById("simplePanelWithTextHeader");
assertEquals("rf-p ", simplePanel2.getAttribute("class"));
assertNotNull(page.getElementById("simplePanelWithTextHeader_header"));
assertEquals("rich-laguna-panel-no-header", page.getElementById("simplePanelWithTextHeader_header")
.getTextContent().trim());
assertEquals("RichFaces is a l", page.getElementById("simplePanelWithTextHeader_body").getTextContent().trim()
.substring(0, 16));
HtmlElement nestedPanelContainer = page.getHtmlElementById("nestedPanelContainer");
assertEquals("rf-p ", nestedPanelContainer.getAttribute("class"));
assertNotNull(page.getElementById("nestedPanelContainer_header"));
assertEquals("||||", page.getElementById("nestedPanelContainer_header").getTextContent().trim());
HtmlElement nestedPanelContainerHeader = page.getHtmlElementById("nestedPanelContainer_header");
assertEquals("rf-p-hdr outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
assertEquals("Benefits of Usin", page.getElementById("nestedPanelContainer_body").getTextContent()
.trim().substring(0, 16));
DomElement nestedPanel1 = page.getElementById("nestedPanel1");
assertEquals("rf-p ", nestedPanel1.getAttribute("class"));
HtmlElement nestedPanel1Body = page.getHtmlElementById("nestedPanel1_body");
assertEquals("rf-p-b inpanelBody", nestedPanel1Body.getAttribute("class"));
assertNotNull(page.getElementById("nestedPanel1_header"));
assertEquals("For Application Developers", page.getElementById("nestedPanel1_header").getTextContent().trim());
assertEquals("Production quali",
page.getElementById("nestedPanel1_body").getTextContent().trim().substring(0, 16));
DomElement nestedPanel2 = page.getElementById("nestedPanel2");
assertEquals("rf-p ", nestedPanel2.getAttribute("class"));
HtmlElement nestedPanel2Body = page.getHtmlElementById("nestedPanel2_body");
assertEquals("rf-p-b inpanelBody", nestedPanel2Body.getAttribute("class"));
assertNotNull(page.getElementById("nestedPanel2_header"));
assertEquals("For Component Developers", page.getElementById("nestedPanel2_header").getTextContent().trim());
assertEquals("Ajax4jsf is Open",
page.getElementById("nestedPanel2_body").getTextContent().trim().substring(0, 16));
}