use of org.apache.wicket.util.tester.TagTester in project wicket by apache.
the class TextFieldTest method requiredAttribute.
/**
* https://issues.apache.org/jira/browse/WICKET-5289
*/
@Test
public void requiredAttribute() {
TestPage testPage = new TestPage();
testPage.textField.setOutputMarkupId(true);
testPage.textField.setType(String.class);
testPage.textField.setRequired(true);
testPage.textField.add(new HTML5Attributes());
tester.startPage(testPage);
TagTester tagTester = tester.getTagById(testPage.textField.getMarkupId());
String required = tagTester.getAttribute("required");
assertEquals("required", required);
}
Aggregations