use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class PageTesterTest method application_path_is_defined_as_a_symbol.
@Test(dataProvider = "testers")
public void application_path_is_defined_as_a_symbol(PageTester tester) {
SymbolSource source = tester.getRegistry().getService(SymbolSource.class);
assertEquals(source.valueForSymbol(TapestryHttpInternalSymbols.APP_PACKAGE_PATH), "org/apache/tapestry5/integration/app2");
}
use of org.apache.tapestry5.test.PageTester 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.test.PageTester 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.test.PageTester 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.test.PageTester 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"));
}
Aggregations