use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class ActionLinkTest method click_link.
@Test
public void click_link() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForActionLink");
Element link = doc.getElementById("link1");
doc = tester.clickLink(link);
assertTrue(doc.toString().contains("You chose: 123"));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class AssetTest method submit_context_asset.
@Test
public void submit_context_asset() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME, "src/test/app2");
Document doc = tester.renderPage("TestPageForAsset");
assertTrue(doc.toString().contains("test.css"));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class FormTest method submit_form.
@Test
public void submit_form() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForForm");
Element form = doc.getElementById("form1");
Map<String, String> fieldValues = CollectionFactory.newMap();
fieldValues.put("t1", "hello");
doc = tester.submitForm(form, fieldValues);
assertTrue(doc.toString().contains("You entered: hello"));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class IfTest method render.
@Test
public void render() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForIf");
assertNotNull(doc.getElementById("1"));
assertNotNull(doc.getElementById("3"));
assertNotNull(doc.getElementById("5"));
assertNotNull(doc.getElementById("8"));
assertNotNull(doc.getElementById("9"));
assertNotNull(doc.getElementById("10"));
assertNotNull(doc.getElementById("13"));
assertNull(doc.getElementById("2"));
assertNull(doc.getElementById("4"));
assertNull(doc.getElementById("6"));
assertNull(doc.getElementById("7"));
assertNull(doc.getElementById("11"));
assertNull(doc.getElementById("12"));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class LoopTest method render.
@Test
public void render() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForLoop");
assertTrue(doc.toString().contains("abcabcabc"));
assertEquals(doc.getElementById("1").getChildMarkup(), "xyz");
}
Aggregations