use of com.gargoylesoftware.htmlunit.html.HtmlSpan in project javaee7-samples by javaee-samples.
the class MyBeanTest method testAgeHighBoundary.
@Test
public void testAgeHighBoundary() throws IOException {
nameInputText.setText("abc");
ageInputText.setText("25");
zipInputText.setText("12345");
HtmlPage result = button.click();
HtmlSpan span = (HtmlSpan) result.getElementById("ageMessage");
assertEquals("", span.asText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlSpan in project javaee7-samples by javaee-samples.
the class MyBeanTest method testZipLessNumbers.
@Test
public void testZipLessNumbers() throws IOException {
nameInputText.setText("abc");
ageInputText.setText("20");
zipInputText.setText("1234");
HtmlPage result = button.click();
HtmlSpan span = (HtmlSpan) result.getElementById("zipMessage");
assertEquals("must match \"[0-9]{5}\"", span.asText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlSpan in project javaee7-samples by javaee-samples.
the class MyBeanTest method testZipMoreNumbers.
@Test
public void testZipMoreNumbers() throws IOException {
nameInputText.setText("abc");
ageInputText.setText("20");
zipInputText.setText("123456");
HtmlPage result = button.click();
HtmlSpan span = (HtmlSpan) result.getElementById("zipMessage");
assertEquals("must match \"[0-9]{5}\"", span.asText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlSpan in project javaee7-samples by javaee-samples.
the class MyBeanTest method testNameLessCharacters.
@Test
public void testNameLessCharacters() throws IOException {
nameInputText.setText("ab");
ageInputText.setText("20");
zipInputText.setText("12345");
HtmlPage result = button.click();
HtmlSpan span = (HtmlSpan) result.getElementById("nameMessage");
assertEquals("At least 3 characters", span.asText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlSpan in project javaee7-samples by javaee-samples.
the class MyBeanTest method testNameBoundary.
@Test
public void testNameBoundary() throws IOException {
nameInputText.setText("abc");
ageInputText.setText("20");
zipInputText.setText("12345");
HtmlPage result = button.click();
HtmlSpan span = (HtmlSpan) result.getElementById("nameMessage");
assertEquals("", span.asText());
}