HtmlElement span1 = page.getHtmlElementById(push1.getClientId(facesContext));
assertNotNull(span1);
scripts = span1.getHtmlElementsByTagName("script");
int i = 0;
for (Iterator it = scripts.iterator(); it.hasNext();) {
HtmlScript item = (HtmlScript) it.next();
DomText text = (DomText) item.getFirstChild();
assertNotNull(text);
assertTrue(text.asText().contains("A4J.AJAX.Push"));
i++;
}
assertEquals(1, i);
HtmlElement span2 = page.getHtmlElementById(push2.getClientId(facesContext));
assertNotNull(span2);
scripts = span2.getHtmlElementsByTagName("script");
i = 0;
for (Iterator it = scripts.iterator(); it.hasNext();) {
HtmlScript item = (HtmlScript) it.next();
DomText text = (DomText) item.getFirstChild();
assertNotNull(text);
assertTrue(text.asText().contains("A4J.AJAX.StopPush"));
i++;