use of com.gargoylesoftware.htmlunit.html.HtmlParagraph in project faces by jakartaee.
the class Spec1IT method testSimpleValidFieldsInvalidBean.
/**
* @see com.sun.faces.ext.component.UIValidateWholeBean
* @see https://github.com/jakartaee/faces/issues/1
*/
@Test
public void testSimpleValidFieldsInvalidBean() throws Exception {
HtmlPage page = webClient.getPage(webUrl);
HtmlTextInput password1 = page.getHtmlElementById("password1");
password1.setValueAttribute("foofoofoo");
HtmlTextInput password2 = page.getHtmlElementById("password2");
password2.setValueAttribute("barbarbar");
HtmlSubmitInput button = page.getHtmlElementById("submit");
page = button.click();
String pageText = page.asXml();
assertTrue(!pageText.contains("[foofoofoo]"));
assertTrue(!pageText.contains("[barbarbar]"));
assertTrue(pageText.contains("Password fields must match"));
HtmlParagraph password1Value = page.getHtmlElementById("password1Value");
assertTrue(password1Value.asNormalizedText().isEmpty());
HtmlParagraph password2Value = page.getHtmlElementById("password2Value");
assertTrue(password2Value.asNormalizedText().isEmpty());
}
Aggregations